1
This commit is contained in:
@@ -72,16 +72,11 @@ 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(SIGTERM | SIGKILL, function ($data) {
|
pcntl_signal(SIGTERM | SIGKILL, function ($data) {
|
||||||
var_dump($data);
|
|
||||||
$pid = file_get_contents(storage('.swoole.pid'));
|
$pid = file_get_contents(storage('.swoole.pid'));
|
||||||
if (!empty($pid) && Process::kill($pid, 0)) {
|
if (!empty($pid) && Process::kill($pid, 0)) {
|
||||||
Process::kill($pid, SIGTERM);
|
Process::kill($pid, SIGTERM);
|
||||||
}
|
}
|
||||||
while ($ret = Process::wait(true)) {
|
|
||||||
echo "PID={$ret['pid']}\n";
|
|
||||||
sleep(1);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
$driver->start();
|
$driver->start();
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user