From ad0154d319805e455d5275713b5fd33f731b5c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 30 Nov 2021 18:29:10 +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/HotReload.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kiri-engine/FileListen/HotReload.php b/kiri-engine/FileListen/HotReload.php index 4d54f827..c4847fc8 100644 --- a/kiri-engine/FileListen/HotReload.php +++ b/kiri-engine/FileListen/HotReload.php @@ -97,10 +97,13 @@ class HotReload extends Command */ public function healthCheck() { - $this->logger->debug('timer ticker.'.Process::kill($this->process->pid, 0)); - if ($this->process && !Process::kill($this->process->pid, 0)) { - echo 'service is shutdown you need reload.'; - + $pid = file_get_contents(storage('.swoole.pid')); + $this->logger->debug('timer ticker.' . Process::kill($pid, 0)); + if (!empty($pid) && !Process::kill($pid, 0)) { + if ($this->process && Process::kill($this->process->pid, 0)) { + echo 'service is shutdown you need reload.'; + Process::kill($this->process->pid, -15); + } $this->trigger_reload(); } }