Skip to content

Commit 60c2ba9

Browse files
authored
prevent calling tries twice (#53010)
1 parent 46dc7a4 commit 60c2ba9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Illuminate/Queue/Queue.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected function createObjectPayload($job, $queue)
143143
'uuid' => (string) Str::uuid(),
144144
'displayName' => $this->getDisplayName($job),
145145
'job' => 'Illuminate\Queue\CallQueuedHandler@call',
146-
'maxTries' => $this->getJobTries($job) ?? null,
146+
'maxTries' => $this->getJobTries($job),
147147
'maxExceptions' => $job->maxExceptions ?? null,
148148
'failOnTimeout' => $job->failOnTimeout ?? false,
149149
'backoff' => $this->getJobBackoff($job),
@@ -191,13 +191,11 @@ public function getJobTries($job)
191191
return;
192192
}
193193

194-
if (isset($job->tries)) {
195-
return $job->tries;
194+
if (is_null($tries = $job->tries ?? $job->tries())) {
195+
return;
196196
}
197197

198-
if (method_exists($job, 'tries') && ! is_null($job->tries())) {
199-
return $job->tries();
200-
}
198+
return $tries;
201199
}
202200

203201
/**

0 commit comments

Comments
 (0)