This commit is contained in:
2021-11-05 00:20:30 +08:00
parent 84e2998139
commit ac66f768c3
@@ -65,14 +65,10 @@ class FileChangeCustomProcess extends Command
} else {
$driver = Kiri::getDi()->get(Inotify::class, [$this->dirs, $this]);
}
$make = Barrier::make();
go(function () {
$this->trigger_reload(0);
});
go(function () use ($driver) {
Coroutine::create(function () use ($driver) {
$driver->start(Coroutine::getCid());
});
Barrier::wait($make);
return 0;
}
@@ -105,7 +101,9 @@ class FileChangeCustomProcess extends Command
if (!empty($content) && Process::kill($content, 0)) {
Process::kill($content, SIGTERM);
}
Coroutine::create(function () {
proc_open("php " . APP_PATH . "kiri.php", [], $pipes);
});
}