Skip to content

Commit

Permalink
fixed get next job method (#53962)
Browse files Browse the repository at this point in the history
  • Loading branch information
rudenav authored Dec 18, 2024
1 parent 6f767a2 commit 1f73ec9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Illuminate/Queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,11 @@ protected function getNextJob($connection, $queue)

try {
if (isset(static::$popCallbacks[$this->name])) {
return tap(
(static::$popCallbacks[$this->name])($popJobCallback, $queue),
fn ($job) => $this->raiseAfterJobPopEvent($connection->getConnectionName(), $job)
);
if (! is_null($job = (static::$popCallbacks[$this->name])($popJobCallback, $queue))) {
$this->raiseAfterJobPopEvent($connection->getConnectionName(), $job);
}

return $job;
}

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

0 comments on commit 1f73ec9

Please sign in to comment.