Skip to content

Commit

Permalink
fix: graceful termination of workers marked for termination
Browse files Browse the repository at this point in the history
  • Loading branch information
tarexme committed Apr 27, 2024
1 parent c918b06 commit c579907
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Supervisor.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ public function terminate($status = 0)
});

if ($this->shouldWait()) {
while ($this->processPools->map->runningProcesses()->collapse()->count()) {
while ($this->processPools->map->runningProcesses()->collapse()->isNotEmpty()
|| $this->terminatingProcesses()->isNotEmpty()) {
sleep(1);
}
}
Expand Down

0 comments on commit c579907

Please sign in to comment.