diff --git a/kiri-engine/FileListen/Inotify.php b/kiri-engine/FileListen/Inotify.php index 6d2a4f68..77c02018 100644 --- a/kiri-engine/FileListen/Inotify.php +++ b/kiri-engine/FileListen/Inotify.php @@ -63,7 +63,6 @@ class Inotify if ($this->process->isReloading) { return; } - $this->process->isReloading = true; $LISTEN_TYPE = [IN_CREATE, IN_DELETE, IN_MODIFY, IN_MOVED_TO, IN_MOVED_FROM]; foreach ($events as $ev) { @@ -72,7 +71,6 @@ class Inotify } //非重启类型 if (str_ends_with($ev['name'], '.php')) { - sleep(1); $this->reload(); } } @@ -83,6 +81,12 @@ class Inotify */ public function reload() { + if ($this->process->isReloading) { + return; + } + + $this->process->isReloading = true; + $this->process->trigger_reload(); $this->clearWatch(); foreach ($this->dirs as $root) {