From 2b037a858b9935ba8a61dfbb32885d6c54983425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 7 Sep 2020 11:51:14 +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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/System/Process/ServerInotify.php b/System/Process/ServerInotify.php index 2acc6a23..f87d3c6f 100644 --- a/System/Process/ServerInotify.php +++ b/System/Process/ServerInotify.php @@ -177,15 +177,21 @@ class ServerInotify extends Process $server->reload(); } + /** * 清理所有inotify监听 */ public function clearWatch() { - foreach ($this->watchFiles as $wd) { - @inotify_rm_watch($this->inotify, $wd); + try { + foreach ($this->watchFiles as $wd) { + @inotify_rm_watch($this->inotify, $wd); + } + } catch (Exception $exception) { + $this->debug($exception->getMessage()); + } finally { + $this->watchFiles = []; } - $this->watchFiles = []; }