From 2bd515a44d799c5f91c6d6161671cee4c81aa101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 18 Mar 2021 18:50:04 +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 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/System/Process/ServerInotify.php b/System/Process/ServerInotify.php index 093ea41e..bc6b6179 100644 --- a/System/Process/ServerInotify.php +++ b/System/Process/ServerInotify.php @@ -41,13 +41,6 @@ class ServerInotify extends Process public function onHandler(\Swoole\Process $process): void { set_error_handler([$this, 'onErrorHandler']); - if (env('debug') != 'true') { - Timer::tick(100000, function () { - - }); - return; - } - $this->dirs = Config::get('inotify', false, [APP_PATH]); if (extension_loaded('inotify')) { $this->inotify = inotify_init(); @@ -72,7 +65,10 @@ class ServerInotify extends Process private function loadDirs($isReload = false) { foreach ($this->dirs as $value) { - $this->loadByDir(realpath($value), $isReload); + if (is_bool($path = realpath($value))) { + continue; + } + $this->loadByDir($path, $isReload); } } @@ -103,6 +99,9 @@ class ServerInotify extends Process */ private function loadByDir($path, $isReload = false): void { + if (!is_string($path)) { + return; + } $path = rtrim($path, '/'); foreach (glob(realpath($path) . '/*') as $value) { if (is_dir($value)) {