<?php pcntl_signal(SIGALRM, function () use ($job, $options) {
if ($job) {
$this->markJobAsFailedIfWillExceedMaxAttempts(
$job->getConnectionName(), $job, (int) $options->maxTries, $e = $this->timeoutExceededException($job)
);
$this->markJobAsFailedIfWillExceedMaxExceptions(
$job->getConnectionName(), $job, $e
);
$this->markJobAsFailedIfItShouldFailOnTimeout(
$job->getConnectionName(), $job, $e
);
$this->events->dispatch(new JobTimedOut(
$job->getConnectionName(), $job
));
}
$this->kill(static::EXIT_ERROR, $options);
}, true);
pcntl_alarm(
max($this->timeoutForJob($job, $options), 0)