Skip to content

Commit 1f73ec9

Browse files
authored
fixed get next job method (#53962)
1 parent 6f767a2 commit 1f73ec9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Illuminate/Queue/Worker.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,11 @@ protected function getNextJob($connection, $queue)
355355

356356
try {
357357
if (isset(static::$popCallbacks[$this->name])) {
358-
return tap(
359-
(static::$popCallbacks[$this->name])($popJobCallback, $queue),
360-
fn ($job) => $this->raiseAfterJobPopEvent($connection->getConnectionName(), $job)
361-
);
358+
if (! is_null($job = (static::$popCallbacks[$this->name])($popJobCallback, $queue))) {
359+
$this->raiseAfterJobPopEvent($connection->getConnectionName(), $job);
360+
}
361+
362+
return $job;
362363
}
363364

364365
foreach (explode(',', $queue) as $index => $queue) {

0 commit comments

Comments
 (0)