This commit is contained in:
2021-11-19 03:45:18 +08:00
parent dbc4cb15dd
commit 43a1fad278
+6 -2
View File
@@ -76,9 +76,13 @@ class HotReload extends Command
swoole_set_process_name('[' . Config::get('id', 'sw service.') . '].sw:wather'); swoole_set_process_name('[' . Config::get('id', 'sw service.') . '].sw:wather');
} }
$this->trigger_reload(); $this->trigger_reload();
Process::signal(SIGKILL, [$this, 'onSignal']);
Process::signal(SIGTERM, [$this, 'onSignal']);
Coroutine::create(function () { Coroutine::create(function () {
Coroutine::create(function () {
$this->onSignal(Coroutine::waitSignal(SIGKILL, -1));
});
Coroutine::create(function () {
$this->onSignal(Coroutine::waitSignal(SIGTERM, -1));
});
$this->driver->start(); $this->driver->start();
}); });
return 0; return 0;