Skip to content

Commit

Permalink
let the worker sleep 1 second more when app is down for maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
halaei committed Sep 20, 2016
1 parent 6eb7cab commit 3572187
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Illuminate/Queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ public function daemon($connectionName, $queue, WorkerOptions $options)
*/
protected function daemonShouldRun()
{
return $this->manager->isDownForMaintenance()
? false : $this->events->until('illuminate.queue.looping') !== false;
if ($this->manager->isDownForMaintenance() || $this->events->until('illuminate.queue.looping') === false) {
$this->sleep(1);

return false;
}

return true;
}

/**
Expand Down

0 comments on commit 3572187

Please sign in to comment.