From a4a9a5618d9f4aeb179477773b455fee0f59f8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 4 Nov 2021 18:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FileListen/FileChangeCustomProcess.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index 9625d5ee..f4c8b1bd 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -67,18 +67,21 @@ class FileChangeCustomProcess extends Command go(function () { $sign = Coroutine::waitSignal(SIGTERM, -1); if ($sign) { + proc_close($this->source); } }); go(function () use ($driver) { $driver->start(); }); - $this->source = proc_open("php " . APP_PATH . "kiri.php sw:server restart", - [ - 0 => ["pipe", "r"], // 标准输入,子进程从此管道中读取数据 - 1 => ["pipe", "w"], // 标准输出,子进程向此管道中写入数据 - 2 => ["file", "/tmp/error-output.txt", "a"] // 标准错误,写入到一个文件 - ] - , $this->pipes); + go(function () { + $this->source = proc_open("php " . APP_PATH . "kiri.php sw:server restart", + [ + 0 => ["pipe", "r"], // 标准输入,子进程从此管道中读取数据 + 1 => ["pipe", "w"], // 标准输出,子进程向此管道中写入数据 + 2 => ["file", "/tmp/error-output.txt", "a"] // 标准错误,写入到一个文件 + ] + , $this->pipes); + }); var_dump($this->source, $this->pipes); Barrier::wait($make);