diff --git a/src/Illuminate/Queue/Worker.php b/src/Illuminate/Queue/Worker.php index a8bd580266f9..ef2589b59221 100644 --- a/src/Illuminate/Queue/Worker.php +++ b/src/Illuminate/Queue/Worker.php @@ -77,8 +77,11 @@ public function daemon($connectionName, $queue, WorkerOptions $options) $this->sleep($options->sleep); } - if ($this->memoryExceeded($options->memory) || - $this->queueShouldRestart($lastRestart)) { + if ($this->memoryExceeded($options->memory)) { + $this->stop(1); + } + + if ($this->queueShouldRestart($lastRestart)) { $this->stop(); } } @@ -389,11 +392,11 @@ public function memoryExceeded($memoryLimit) * * @return void */ - public function stop() + public function stop($status = 0) { $this->events->fire(new Events\WorkerStopping); - die; + exit($status); } /**