From 43a1fad278c401f9a41a073aeaa0b6b757da7561 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 19 Nov 2021 03:45:18 +0800 Subject: [PATCH] 1 --- kiri-engine/FileListen/HotReload.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kiri-engine/FileListen/HotReload.php b/kiri-engine/FileListen/HotReload.php index 785294cc..aa896227 100644 --- a/kiri-engine/FileListen/HotReload.php +++ b/kiri-engine/FileListen/HotReload.php @@ -76,9 +76,13 @@ class HotReload extends Command swoole_set_process_name('[' . Config::get('id', 'sw service.') . '].sw:wather'); } $this->trigger_reload(); - Process::signal(SIGKILL, [$this, 'onSignal']); - Process::signal(SIGTERM, [$this, 'onSignal']); Coroutine::create(function () { + Coroutine::create(function () { + $this->onSignal(Coroutine::waitSignal(SIGKILL, -1)); + }); + Coroutine::create(function () { + $this->onSignal(Coroutine::waitSignal(SIGTERM, -1)); + }); $this->driver->start(); }); return 0;