改名
This commit is contained in:
@@ -83,7 +83,6 @@ class HotReload extends Command
|
|||||||
$this->trigger_reload();
|
$this->trigger_reload();
|
||||||
|
|
||||||
var_dump(getmypid());
|
var_dump(getmypid());
|
||||||
|
|
||||||
Process::signal(SIGTERM, [$this, 'onSignal']);
|
Process::signal(SIGTERM, [$this, 'onSignal']);
|
||||||
Process::signal(SIGKILL, [$this, 'onSignal']);
|
Process::signal(SIGKILL, [$this, 'onSignal']);
|
||||||
|
|
||||||
@@ -144,11 +143,9 @@ class HotReload extends Command
|
|||||||
// if (!empty($pid) && Process::kill($pid, 0)) {
|
// if (!empty($pid) && Process::kill($pid, 0)) {
|
||||||
// Process::kill($pid, SIGTERM);
|
// Process::kill($pid, SIGTERM);
|
||||||
// }
|
// }
|
||||||
var_dump('kill process.');
|
|
||||||
if ($this->process && Process::kill($this->process->pid,0)) {
|
if ($this->process && Process::kill($this->process->pid,0)) {
|
||||||
Process::kill($this->process->pid) && Process::wait(true);
|
Process::kill($this->process->pid) && Process::wait(true);
|
||||||
}
|
}
|
||||||
var_dump('kill process end.');
|
|
||||||
$this->process = new Process(function (Process $process) {
|
$this->process = new Process(function (Process $process) {
|
||||||
$process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "restart"]);
|
$process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "restart"]);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -63,8 +63,6 @@ class Inotify
|
|||||||
if (!($events = inotify_read($this->inotify))) {
|
if (!($events = inotify_read($this->inotify))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var_dump($this->process->isReloading);
|
|
||||||
if ($this->process->isReloading) {
|
if ($this->process->isReloading) {
|
||||||
if (!$this->process->isReloadingOut) {
|
if (!$this->process->isReloadingOut) {
|
||||||
$this->process->isReloadingOut = true;
|
$this->process->isReloadingOut = true;
|
||||||
@@ -81,12 +79,8 @@ class Inotify
|
|||||||
if ($this->process->int !== -1) {
|
if ($this->process->int !== -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(200);
|
usleep(200);
|
||||||
|
|
||||||
$this->reload();
|
$this->reload();
|
||||||
|
|
||||||
$this->process->isReloading = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,9 +92,6 @@ class Inotify
|
|||||||
{
|
{
|
||||||
$this->process->isReloading = true;
|
$this->process->isReloading = true;
|
||||||
$this->process->trigger_reload();
|
$this->process->trigger_reload();
|
||||||
|
|
||||||
var_dump('trigger_reload');
|
|
||||||
|
|
||||||
$this->clearWatch();
|
$this->clearWatch();
|
||||||
foreach ($this->dirs as $root) {
|
foreach ($this->dirs as $root) {
|
||||||
$this->watch($root);
|
$this->watch($root);
|
||||||
|
|||||||
Reference in New Issue
Block a user