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);
                }
            }
        }
    }