From 5fffe530227fee9835cef27f339ecc7b29a8c73d Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 5 Nov 2021 00:02:43 +0800 Subject: [PATCH] 111 --- kiri-engine/FileListen/FileChangeCustomProcess.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index 836b1baf..4d72cdb8 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -103,8 +103,12 @@ class FileChangeCustomProcess extends Command $content = (int)file_get_contents(storage('.swoole.pid')); if (!empty($content) && Process::kill($content, 0)) { Process::kill($content, SIGTERM); + while (Process::kill($content,0)) { + Coroutine::sleep(0.01); + } + proc_close($this->source); } - proc_open("php " . APP_PATH . "kiri.php", [], $pipes); + $this->source = proc_open("php " . APP_PATH . "kiri.php", [], $pipes); }