From 6a30fdfa8d01918ecc244e427895978788312edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 12 Jan 2022 15:08:22 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=94=B9=E5=90=8D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fdf58326 --- kiri-engine/FileListen/HotReload.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kiri-engine/FileListen/HotReload.php b/kiri-engine/FileListen/HotReload.php index 91b8d69b..19719267 100644 --- a/kiri-engine/FileListen/HotReload.php +++ b/kiri-engine/FileListen/HotReload.php @@ -203,10 +203,6 @@ class HotReload extends Command */ public function trigger_reload(string $path = '') { - if ($this->int == 1) { - return; - } - $this->int = 1; $this->logger->warning('change reload'); if (!empty($path) && str_starts_with($path, CONTROLLER_PATH)) { $pid = file_get_contents(storage('.swoole.pid')); @@ -214,6 +210,10 @@ class HotReload extends Command Process::kill($pid, SIGUSR1); } } else { + if ($this->int == 1) { + return; + } + $this->int = 1; $this->stopServer(); $this->process = new Process(function (Process $process) { $process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "start"]);