From 39be8f4b3bc06b9cd43773e98db065843e4bb23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 4 Nov 2021 18:03:24 +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/FileChangeCustomProcess.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index 1a7b67fb..7e6853bc 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -30,7 +30,7 @@ class FileChangeCustomProcess extends Command public int $int = -1; - protected mixed $source; + protected mixed $source = null; /** @@ -69,7 +69,7 @@ class FileChangeCustomProcess extends Command go(function () { $sign = Coroutine::waitSignal(SIGTERM, -1); if ($sign) { - if ($this->source) { + if (is_resource($this->source)) { proc_close($this->source); } $this->source = proc_open("php " . APP_PATH . "kiri.php sw:server stop", [], $pipes); @@ -107,7 +107,7 @@ class FileChangeCustomProcess extends Command public function trigger_reload() { Kiri::getDi()->get(Logger::class)->warning('change reload'); - if ($this->source) { + if (is_resource($this->source)) { proc_close($this->source); } $this->source = proc_open("php " . APP_PATH . "kiri.php sw:server restart", [], $pipes);