改名
This commit is contained in:
@@ -74,7 +74,20 @@ 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(getmypid());
|
||||
|
||||
Process::signal(SIGTERM, [$this, 'onSignal']);
|
||||
Process::signal(SIGKILL, [$this, 'onSignal']);
|
||||
|
||||
$this->driver->start();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function onSignal($data)
|
||||
{
|
||||
var_dump($data);
|
||||
$this->driver->clear();
|
||||
$pid = file_get_contents(storage('.swoole.pid'));
|
||||
@@ -85,9 +98,6 @@ class HotReload extends Command
|
||||
echo "PID={$ret['pid']}\n";
|
||||
sleep(1);
|
||||
}
|
||||
});
|
||||
$this->driver->start();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user