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 { } else {
$driver = Kiri::getDi()->get(Inotify::class, [$this->dirs, $this]); $driver = Kiri::getDi()->get(Inotify::class, [$this->dirs, $this]);
} }
$make = Barrier::make();
go(function () {
$this->trigger_reload(0); $this->trigger_reload(0);
}); Coroutine::create(function () use ($driver) {
go(function () use ($driver) {
$driver->start(Coroutine::getCid()); $driver->start(Coroutine::getCid());
}); });
Barrier::wait($make);
return 0; return 0;
} }
@@ -105,7 +101,9 @@ class FileChangeCustomProcess extends Command
if (!empty($content) && Process::kill($content, 0)) { if (!empty($content) && Process::kill($content, 0)) {
Process::kill($content, SIGTERM); Process::kill($content, SIGTERM);
} }
Coroutine::create(function () {
proc_open("php " . APP_PATH . "kiri.php", [], $pipes); proc_open("php " . APP_PATH . "kiri.php", [], $pipes);
});
} }