Skip to content

Commit

Permalink
set lastPushed when executing the delayed enqueue closure not before (
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Jan 4, 2021
1 parent f91245c commit 2bd8399
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/RedisQueue.php
Expand Up @@ -41,9 +41,17 @@ public function readyNow($queue = null)
*/
public function push($job, $data = '', $queue = null)
{
$this->lastPushed = $job;

return parent::push($job, $data, $queue);
return $this->enqueueUsing(
$job,
$this->createPayload($job, $this->getQueue($queue), $data),
$queue,
null,
function ($payload, $queue) use ($job) {
$this->lastPushed = $job;

return $this->pushRaw($payload, $queue);
}
);
}

/**
Expand Down

0 comments on commit 2bd8399

Please sign in to comment.