laravel-async-queue
laravel-async-queue copied to clipboard
Alternative to the later method
Hello, an alternative to work as expected the later method:
On class: \Barryvdh\Queue\AsyncQueue
public function getJobFromId($id, bool $waitUntilAvaible = true)
{
$job = $this->database->table($this->table)
->where('id', $id)
->first();
if ($waitUntilAvaible && $job->available_at > $this->currentTime()) sleep($job->available_at - $this->currentTime());
if ($job) {
$job = $this->markJobAsReserved(new DatabaseJobRecord((object) $job));
return new DatabaseJob(
$this->container, $this, $job, $this->connectionName, $job->queue
);
}
}