From 59993c68cedb67c0f18e67720cfa26fb95ed5782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 18 Sep 2020 21:52:09 +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 | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/System/Process/ServerInotify.php b/System/Process/ServerInotify.php index f7710851..a3583bb8 100644 --- a/System/Process/ServerInotify.php +++ b/System/Process/ServerInotify.php @@ -158,22 +158,21 @@ class ServerInotify extends Process public function reload() { $this->isReloading = true; - - //清理所有监听 $this->trigger_reload(); - $this->clearWatch(); - - //重新监听 - foreach ($this->dirs as $root) { - $this->watch($root); + if (Snowflake::isLinux()) { + $this->clearWatch(); + foreach ($this->dirs as $root) { + $this->watch($root); + } } - $this->int = -1; $this->isReloading = FALSE; $this->isReloadingOut = FALSE; - - $this->loadByDir(APP_PATH . 'app'); - $this->loadByDir(APP_PATH . 'routes'); + $this->md5Map = []; + if (Snowflake::isMac()) { + $this->loadByDir(APP_PATH . 'app'); + $this->loadByDir(APP_PATH . 'routes'); + } } /**