Skip to content

Commit 18e342f

Browse files
committed
Handle use queue default attempts
1 parent 2c5d0ff commit 18e342f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Queue.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,9 @@ protected function handleMessage($id, $message, $ttr, $attempt)
228228

229229
// Handle aborted jobs without thrown error
230230
if ($attempt > 1) {
231-
if ($job instanceof RetryableJobInterface && !$job->canRetry($attempt - 1, $error)) {
231+
if ($job instanceof RetryableJobInterface && !$job->canRetry($attempt, $error)) {
232232
return true;
233-
} else {
234-
// Non RetryableJobs can have a maximum of one attempt
233+
} elseif ($attempt > $this->attempts) {
235234
return true;
236235
}
237236
}

0 commit comments

Comments
 (0)