diff --git a/app/Console/Commands/Cluster/Work.php b/app/Console/Commands/Cluster/Work.php index 573a5ff..e76b4c6 100644 --- a/app/Console/Commands/Cluster/Work.php +++ b/app/Console/Commands/Cluster/Work.php @@ -125,7 +125,6 @@ public function handle(): int $this->pipeCommand($command); } else { - // 子进程 $this->report(); } @@ -228,5 +227,17 @@ private function pipeCommand($command): void echo $s; } } + + // 命令结束后,关闭管道 + fclose($pipes[0]); + + fclose($pipes[1]); + + fclose($pipes[2]); + + // 关闭进程 + + proc_close($process); + } }