Skip to content

Commit

Permalink
Update runningProcesses to also include terminating processes (#1454)
Browse files Browse the repository at this point in the history
runningProcess() only checks $this->processes. But this doesn't include terminating processes, which are technically also running processes.
  • Loading branch information
nckrtl authored May 31, 2024
1 parent 4400962 commit 3c359e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ProcessPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ public function processes()
*/
public function runningProcesses()
{
return collect($this->processes)->filter(function ($process) {
$terminatingProcesses = $this->terminatingProcesses()->map(function ($process) {
return $process['process'];
});

return collect($this->processes)->concat($terminatingProcesses)->filter(function ($process) {
return $process->process->isRunning();
});
}
Expand Down

0 comments on commit 3c359e3

Please sign in to comment.