This commit is contained in:
xl
2023-07-10 02:22:38 +08:00
parent 63a89745d9
commit 611ae77bed
+2 -1
View File
@@ -97,11 +97,12 @@ class HotReload extends BaseProcess
Event::add($init, fn() => $this->check($init)); Event::add($init, fn() => $this->check($init));
Event::cycle(function () use ($init) { Event::cycle(function () use ($init) {
$pid = (int)file_get_contents(storage('.swoole.pid')); $pid = (int)file_get_contents(storage('.swoole.pid'));
var_dump($this->isStop());
if ($pid <= 0 || !Process::kill($pid, 0) || $this->isStop()) { if ($pid <= 0 || !Process::kill($pid, 0) || $this->isStop()) {
Event::del($init); Event::del($init);
} }
}, true); }, true);
// Event::wait(); Event::wait();
} }