code: public function updateJob(EntityJobInterface $job, Status $status, $processingTime = 0, $response = null)
      {
          $job->setStatus($status);
          $job->setProcessingTime($job->getProcessingTime() + ($processingTime === null ? 0 : $processingTime));
          $job->setResponse($response);
  
          if (Status::isTerminated($status)) {
              $job->setTerminatedAt(new \DateTime());
          }
  
          if ($job->hasSchedules() && Status::isTerminated($status)) {
              foreach ($job->getSchedules() as $schedule) {
                  if (method_exists($schedule, 'setIsActive')) {
                      $schedule->setIsActive(false);
                  }
              }
          }
      }
docs: Updates a job.
  
  If the given status is ERROR or CANCELLED the child jobs of the given job will be terminated with status CANCELLED.
  
  @param EntityJobInterface $job
  @param Status             $status
  @param int                $processingTime
  @param mixed|null         $response