Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

Commit 4e95010

Browse files
committed
Sleep
1 parent c2f8198 commit 4e95010

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/AsyncQueue.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Queue\DatabaseQueue;
66
use Illuminate\Queue\Jobs\DatabaseJob;
77
use Symfony\Component\Process\Process;
8+
use Carbon\Carbon;
89

910
class AsyncQueue extends DatabaseQueue
1011
{
@@ -130,7 +131,7 @@ public function getJobFromId($id)
130131
if($job) {
131132

132133
return new DatabaseJob(
133-
$this->container, $this, $job, $queue
134+
$this->container, $this, $job, $job->queue
134135
);
135136
}
136137
}

src/Console/AsyncCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ protected function processJob($connectionName, $id)
7474
// we will "sleep" the worker for the specified number of seconds.
7575
if ( ! is_null($job))
7676
{
77-
$sleep = $job->available_at - time();
77+
$sleep = max($job->getDatabaseJob()->available_at - time(), 0);
7878
sleep($sleep);
7979
return $this->worker->process(
80-
$manager->getName($connectionName), $job, $maxTries, $delay
80+
$manager->getName($connectionName), $job
8181
);
8282
}
8383

0 commit comments

Comments
 (0)