From 56f79e2b6e4ee99b26be0c5c73d57cd3a3974fd1 Mon Sep 17 00:00:00 2001 From: Mohamed Said Date: Fri, 13 Nov 2020 16:12:49 +0200 Subject: [PATCH] ignore max attempts if retryUntil is set (#35214) --- src/Illuminate/Queue/Worker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Queue/Worker.php b/src/Illuminate/Queue/Worker.php index 677b4ba9c346..f2ba7b1a01ad 100644 --- a/src/Illuminate/Queue/Worker.php +++ b/src/Illuminate/Queue/Worker.php @@ -501,7 +501,7 @@ protected function markJobAsFailedIfWillExceedMaxAttempts($connectionName, $job, $this->failJob($job, $e); } - if ($maxTries > 0 && $job->attempts() >= $maxTries) { + if (! $job->retryUntil() && $maxTries > 0 && $job->attempts() >= $maxTries) { $this->failJob($job, $e); } }