From f87ddff5853860362cc654d186df77e597a5d3ae Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 5 Nov 2021 01:23:22 +0800 Subject: [PATCH] 111 --- kiri-engine/FileListen/FileChangeCustomProcess.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index cd40ff56..b834cb44 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -105,13 +105,17 @@ class FileChangeCustomProcess extends Command Process::kill($content,15); } @unlink(storage('.swoole.pid')); + + if (is_resource($this->source)) { + proc_close($this->source); + $this->source = null; + } } Coroutine::create(function () { $descriptorspec = [0 => STDIN, 1 => STDOUT, 2 => STDERR]; - $proc = proc_open("php " . APP_PATH . "kiri.php", $descriptorspec, $pipes); - proc_close($proc); + $this->source = proc_open("php " . APP_PATH . "kiri.php", $descriptorspec, $pipes); }); }