laravel-async-queue icon indicating copy to clipboard operation
laravel-async-queue copied to clipboard

Alternative to the later method

Open gsoareslima opened this issue 5 years ago • 0 comments

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 ); } }

gsoareslima avatar Aug 20 '20 19:08 gsoareslima