This commit is contained in:
2023-04-19 15:05:28 +08:00
parent 28c139fa50
commit 12b2b0fe48
+6
View File
@@ -128,6 +128,12 @@ class HotReload extends Command
$this->watch($init, $dir);
}
Event::add($init, fn() => $this->check($init));
Event::cycle(function () use ($init) {
$pid = (int)file_get_contents(storage('.swoole.pid'));
if ($pid <= 0 || !Process::kill($pid, 0)) {
Event::del($init);
}
}, true);
Event::wait();
}