Skip to content

Commit

Permalink
execute garbage collection before over limit memory queue worker stop…
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-ogawa committed Dec 25, 2018
1 parent 79f34c8 commit 14ecff3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Illuminate/Queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ protected function stopIfNecessary(WorkerOptions $options, $lastRestart)
}

if ($this->memoryExceeded($options->memory)) {
$this->stop(12);
gc_collect_cycles();
if ($this->memoryExceeded($options->memory)) {
$this->stop(12);
}
} elseif ($this->queueShouldRestart($lastRestart)) {
$this->stop();
}
Expand Down

0 comments on commit 14ecff3

Please sign in to comment.