From 3c359e3a9ebd3e3be012a15eedf2d64ef8b82540 Mon Sep 17 00:00:00 2001 From: Nick Retel Date: Fri, 31 May 2024 18:18:41 +0200 Subject: [PATCH] Update runningProcesses to also include terminating processes (#1454) runningProcess() only checks $this->processes. But this doesn't include terminating processes, which are technically also running processes. --- src/ProcessPool.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ProcessPool.php b/src/ProcessPool.php index 2f07cec6..11697aee 100644 --- a/src/ProcessPool.php +++ b/src/ProcessPool.php @@ -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(); }); }