From c66b76d0be2e2d911b5e0335458c3f7a40cfcf82 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 5 Nov 2021 01:07:23 +0800 Subject: [PATCH] 111 --- kiri-engine/FileListen/FileChangeCustomProcess.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index b9321a30..2c0911d3 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -97,6 +97,14 @@ class FileChangeCustomProcess extends Command public function trigger_reload() { Kiri::getDi()->get(Logger::class)->warning('change reload'); + + if (file_exists(storage('.swoole.pid'))) { + $content = (int)file_get_contents(storage('.swoole.pid')); + if ($content > 0 && Process::kill($content,0)){ + Process::kill($content,15); + } + } + Coroutine::create(function () { if (!$this->channel) { $this->channel = new Coroutine\Channel(1);