This commit is contained in:
2021-11-30 18:29:10 +08:00
parent edb70d2b9b
commit ad0154d319
+7 -4
View File
@@ -97,10 +97,13 @@ class HotReload extends Command
*/ */
public function healthCheck() public function healthCheck()
{ {
$this->logger->debug('timer ticker.'.Process::kill($this->process->pid, 0)); $pid = file_get_contents(storage('.swoole.pid'));
if ($this->process && !Process::kill($this->process->pid, 0)) { $this->logger->debug('timer ticker.' . Process::kill($pid, 0));
echo 'service is shutdown you need reload.'; if (!empty($pid) && !Process::kill($pid, 0)) {
if ($this->process && Process::kill($this->process->pid, 0)) {
echo 'service is shutdown you need reload.';
Process::kill($this->process->pid, -15);
}
$this->trigger_reload(); $this->trigger_reload();
} }
} }