protected function markJobAsFailedIfAlreadyExceedsMaxAttempts($connectionName, $job, $maxTries)
{
$maxTries = !is_null($job->maxTries()) ? $job->maxTries() : $maxTries;
if ($maxTries === 0 || $job->attempts() <= $maxTries) {
return;
}
$e = new MaxAttemptsExceededException('A queued job has been attempted too many times. The job may have previously timed out.');
$this->failJob($connectionName, $job, $e);
throw $e;
}