Illuminate\Queue\Worker::markJobAsFailedIfHasExceededMaxAttempts PHP Method

markJobAsFailedIfHasExceededMaxAttempts() protected method

Mark the given job as failed if it has exceeded the maximum allowed attempts.
protected markJobAsFailedIfHasExceededMaxAttempts ( string $connectionName, Illuminate\Contracts\Queue\Job $job, integer $maxTries, Exception $e ) : void
$connectionName string
$job Illuminate\Contracts\Queue\Job
$maxTries integer
$e Exception
return void
    protected function markJobAsFailedIfHasExceededMaxAttempts($connectionName, $job, $maxTries, $e)
    {
        $maxTries = !is_null($job->maxTries()) ? $job->maxTries() : $maxTries;
        if ($maxTries === 0 || $job->attempts() < $maxTries) {
            return;
        }
        $this->failJob($connectionName, $job, $e);
    }