From 873da66a90e8fc64c51b1e24f6e444289812e637 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 19 Nov 2021 02:20:04 +0800 Subject: [PATCH] 1 --- kiri-engine/FileListen/HotReload.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kiri-engine/FileListen/HotReload.php b/kiri-engine/FileListen/HotReload.php index 88d99f95..af3a30e4 100644 --- a/kiri-engine/FileListen/HotReload.php +++ b/kiri-engine/FileListen/HotReload.php @@ -72,16 +72,11 @@ class HotReload extends Command swoole_set_process_name('[' . Config::get('id', 'sw service.') . '].sw:wather'); } $this->trigger_reload(); - Process::signal(SIGTERM | SIGKILL, function ($data) { - var_dump($data); + pcntl_signal(SIGTERM | SIGKILL, function ($data) { $pid = file_get_contents(storage('.swoole.pid')); if (!empty($pid) && Process::kill($pid, 0)) { Process::kill($pid, SIGTERM); } - while ($ret = Process::wait(true)) { - echo "PID={$ret['pid']}\n"; - sleep(1); - } }); $driver->start(); return 0;