From 2950ba8fd56f23ac8dc167b9c562eafee4948cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 6 Dec 2021 14:24:41 +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, 4 insertions(+), 6 deletions(-) diff --git a/kiri-engine/FileListen/HotReload.php b/kiri-engine/FileListen/HotReload.php index 9c499c78..fcce897e 100644 --- a/kiri-engine/FileListen/HotReload.php +++ b/kiri-engine/FileListen/HotReload.php @@ -147,16 +147,14 @@ class HotReload extends Command { $this->logger->warning('change reload'); $pid = $this->process?->pid; - $process = new Process(function (Process $process) { - $process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "restart"]); - - $this->logger->warning('service stop.'); - }); - $process->start(); if ($pid && Process::kill($pid, 0)) { Process::kill($pid) && Process::wait(true); } $this->process = null; + $process = new Process(function (Process $process) { + $process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "restart"]); + }); + $process->start(); $this->process = $process; }