From 786f96363b894647c4fe2c72c3f7b642ae8ade94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 19 Nov 2021 11:11:40 +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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kiri-engine/FileListen/HotReload.php b/kiri-engine/FileListen/HotReload.php index ef7cccaa..3d536299 100644 --- a/kiri-engine/FileListen/HotReload.php +++ b/kiri-engine/FileListen/HotReload.php @@ -140,13 +140,15 @@ class HotReload extends Command public function trigger_reload() { $this->logger->warning('change reload'); - $pid = file_get_contents(storage('.swoole.pid')); - if (!empty($pid) && Process::kill($pid, 0)) { - Process::kill($pid, SIGTERM); - } +// $pid = file_get_contents(storage('.swoole.pid')); +// if (!empty($pid) && Process::kill($pid, 0)) { +// Process::kill($pid, SIGTERM); +// } + var_dump('kill process.'); if ($this->process && Process::kill($this->process->pid,0)) { Process::kill($this->process->pid) && Process::wait(true); } + var_dump('kill process end.'); $this->process = new Process(function (Process $process) { $process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "restart"]); });