Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Alternative to the later method #92

Open
gsoareslima opened this issue Aug 20, 2020 · 0 comments
Open

Alternative to the later method #92

gsoareslima opened this issue Aug 20, 2020 · 0 comments

Comments

@gsoareslima
Copy link

gsoareslima commented Aug 20, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant