From 3f49a92e28272a0763b8c65ab649d95f1893bc45 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Thu, 5 Jan 2023 13:24:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B8=BA=20pipe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Cluster/Work.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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); + } }