From f80ec2eb9d7f44800e7b3717042c3a5c5a76ce51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 3 Sep 2020 01:37:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/Process/ServerInotify.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/system/Process/ServerInotify.php b/system/Process/ServerInotify.php index 89feec1f..1df07a92 100644 --- a/system/Process/ServerInotify.php +++ b/system/Process/ServerInotify.php @@ -76,6 +76,9 @@ class ServerInotify extends Process private function loadByDir($path, $isReload = false) { $path = rtrim($path, '/'); + if ($this->isReloading) { + return; + } foreach (glob($path . '/*') as $value) { if (is_dir($value)) { $this->loadByDir($value, $isReload); @@ -148,6 +151,8 @@ class ServerInotify extends Process */ public function reload() { + $this->isReloading = true; + //清理所有监听 $this->trigger_reload(); $this->clearWatch(); @@ -160,6 +165,8 @@ class ServerInotify extends Process $this->int = -1; $this->isReloading = FALSE; $this->isReloadingOut = FALSE; + + $this->loadByDir(APP_PATH . 'app'); } /**