From da5d74f519d338255ec887c1eb398080f72a2a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 5 Nov 2021 14:24:49 +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 --- kiri-engine/FileListen/FileChangeCustomProcess.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index d4ce6c3d..8a1adf4c 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -8,7 +8,6 @@ use Kiri\Abstracts\Logger; use Kiri\Exception\ConfigException; use Kiri\Kiri; use Swoole\Coroutine; -use Swoole\Process; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -99,6 +98,10 @@ class FileChangeCustomProcess extends Command if (is_resource($this->source)) { proc_terminate($this->source); + while (proc_get_status($this->source)['running']) { + Coroutine::sleep(0.001); + } + proc_close($this->source); $this->source = null; } }