From 3572187673ba91d5ff016846e3d82a287a3c59c3 Mon Sep 17 00:00:00 2001 From: halaei Date: Tue, 20 Sep 2016 18:33:37 +0430 Subject: [PATCH] let the worker sleep 1 second more when app is down for maintenance --- src/Illuminate/Queue/Worker.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Queue/Worker.php b/src/Illuminate/Queue/Worker.php index f5dc9166a273..c0d3a2f34a15 100644 --- a/src/Illuminate/Queue/Worker.php +++ b/src/Illuminate/Queue/Worker.php @@ -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; } /**