Skip to content

Commit 99d9f89

Browse files
committed
Combined Conditions
1 parent 1cbc278 commit 99d9f89

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Queue.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,10 @@ protected function handleMessage($id, $message, $ttr, $attempt)
227227
list($job, $error) = $this->unserializeMessage($message);
228228

229229
// Handle aborted jobs without thrown error
230-
if ($attempt > 1) {
231-
if ($job instanceof RetryableJobInterface && !$job->canRetry($attempt - 1, $error)) {
232-
return true;
233-
} elseif (!($job instanceof RetryableJobInterface) && $attempt > $this->attempts) {
234-
return true;
235-
}
230+
if ($attempt > 1 &&
231+
(($job instanceof RetryableJobInterface && !$job->canRetry($attempt - 1, $error))
232+
|| (!($job instanceof RetryableJobInterface) && $attempt > $this->attempts))) {
233+
return true;
236234
}
237235

238236
$event = new ExecEvent([

0 commit comments

Comments
 (0)