This commit is contained in:
2020-10-21 15:11:46 +08:00
parent 6f1e0635eb
commit 05f990df40
2 changed files with 11 additions and 3 deletions
+11
View File
@@ -29,6 +29,17 @@ class OnStart extends Callback
if (Snowflake::isLinux()) {
name(rtrim(Config::get('id', 'system:'), ':'));
}
Process::signal(9 | 15, function () use ($server) {
while ($ret = Process::wait()) {
if ($ret['signal'] == 9 || $ret['signal'] == 15) {
$server->shutdown();
} else {
$server->reload();
}
}
});
}
}