改名
This commit is contained in:
@@ -138,17 +138,15 @@ class HotReload extends Command
|
|||||||
public function trigger_reload()
|
public function trigger_reload()
|
||||||
{
|
{
|
||||||
$this->logger->warning('change reload');
|
$this->logger->warning('change reload');
|
||||||
// $pid = file_get_contents(storage('.swoole.pid'));
|
$pid = $this->process->pid;
|
||||||
// if (!empty($pid) && Process::kill($pid, 0)) {
|
$process = new Process(function (Process $process) {
|
||||||
// Process::kill($pid, SIGTERM);
|
|
||||||
// }
|
|
||||||
if ($this->process && Process::kill($this->process->pid, 0)) {
|
|
||||||
Process::kill($this->process->pid) && Process::wait(true);
|
|
||||||
}
|
|
||||||
$this->process = new Process(function (Process $process) {
|
|
||||||
$process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "restart"]);
|
$process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "restart"]);
|
||||||
});
|
});
|
||||||
$this->process->start();
|
$process->start();
|
||||||
|
if ($pid && Process::kill($pid, 0)) {
|
||||||
|
Process::kill($pid) && Process::wait(true);
|
||||||
|
}
|
||||||
|
$this->process = $process;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user