This commit is contained in:
2021-11-19 10:40:49 +08:00
parent f4596bf02c
commit 0f172ae62d
+1 -6
View File
@@ -124,8 +124,6 @@ class HotReload extends Command
} }
/** /**
* 重启 * 重启
* *
@@ -139,14 +137,11 @@ class HotReload extends Command
Process::kill($pid, SIGTERM); Process::kill($pid, SIGTERM);
} }
Process::wait(true); Process::wait(true);
if (!$this->process) { $this->process?->exit();
$this->process = new Process(function (Process $process) { $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(); $this->process->start();
} else {
$this->process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "restart"]);
}
} }