This commit is contained in:
2021-11-19 11:15:40 +08:00
parent 3943142b86
commit 493ef65ce8
2 changed files with 0 additions and 12 deletions
-3
View File
@@ -83,7 +83,6 @@ class HotReload extends Command
$this->trigger_reload();
var_dump(getmypid());
Process::signal(SIGTERM, [$this, 'onSignal']);
Process::signal(SIGKILL, [$this, 'onSignal']);
@@ -144,11 +143,9 @@ class HotReload extends Command
// if (!empty($pid) && Process::kill($pid, 0)) {
// Process::kill($pid, SIGTERM);
// }
var_dump('kill process.');
if ($this->process && Process::kill($this->process->pid,0)) {
Process::kill($this->process->pid) && Process::wait(true);
}
var_dump('kill process end.');
$this->process = new Process(function (Process $process) {
$process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "restart"]);
});
-9
View File
@@ -63,8 +63,6 @@ class Inotify
if (!($events = inotify_read($this->inotify))) {
return;
}
var_dump($this->process->isReloading);
if ($this->process->isReloading) {
if (!$this->process->isReloadingOut) {
$this->process->isReloadingOut = true;
@@ -81,12 +79,8 @@ class Inotify
if ($this->process->int !== -1) {
return;
}
usleep(200);
$this->reload();
$this->process->isReloading = true;
}
}
}
@@ -98,9 +92,6 @@ class Inotify
{
$this->process->isReloading = true;
$this->process->trigger_reload();
var_dump('trigger_reload');
$this->clearWatch();
foreach ($this->dirs as $root) {
$this->watch($root);