diff --git a/System/Process/ServerInotify.php b/System/Process/ServerInotify.php index d40c956a..008c6f6e 100644 --- a/System/Process/ServerInotify.php +++ b/System/Process/ServerInotify.php @@ -51,7 +51,7 @@ class ServerInotify extends Process foreach ($this->dirs as $dir) { $this->loadByDir($dir); } - Timer::tick(2000, [$this, 'tick']); + Timer::after(2000, [$this, 'tick']); } } @@ -67,6 +67,10 @@ class ServerInotify extends Process foreach ($this->dirs as $dir) { $this->loadByDir($dir, true); } + if ($this->isReloading) { + return; + } + Timer::after(2000, [$this, 'tick']); } @@ -92,7 +96,6 @@ class ServerInotify extends Process if (!isset($this->md5Map[$md5])) { if ($isReload) { $this->isReloading = true; - Timer::clearAll(); return Timer::after(2000, [$this, 'timerReload']); } $this->md5Map[$md5] = $mTime; @@ -100,7 +103,6 @@ class ServerInotify extends Process if ($this->md5Map[$md5] != $mTime) { if ($isReload) { $this->isReloading = true; - Timer::clearAll(); return Timer::after(2000, [$this, 'timerReload']); } $this->md5Map[$md5] = $mTime; @@ -177,13 +179,14 @@ class ServerInotify extends Process $this->isReloading = true; $this->trigger_reload(); $this->int = -1; - $this->isReloading = FALSE; - $this->isReloadingOut = FALSE; $this->md5Map = []; $this->loadByDir(APP_PATH . 'app'); $this->loadByDir(APP_PATH . 'routes'); - Timer::tick(2000, [$this, 'tick']); + $this->isReloading = FALSE; + $this->isReloadingOut = FALSE; + + Timer::after(2000, [$this, 'tick']); } /**