From 36dd6fbcc6742c9d3f25227cda8e02fcb7ebb735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 7 Sep 2020 11:54:57 +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 --- HttpServer/Server.php | 1 + System/Process/ServerInotify.php | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/HttpServer/Server.php b/HttpServer/Server.php index 693f04a4..d2eca66b 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -111,6 +111,7 @@ class Server extends Application SWOOLE_HOOK_SSL | SWOOLE_HOOK_TLS | SWOOLE_HOOK_SLEEP | + SWOOLE_HOOK_STREAM_FUNCTION | SWOOLE_HOOK_PROC ); } diff --git a/System/Process/ServerInotify.php b/System/Process/ServerInotify.php index f87d3c6f..cba532bf 100644 --- a/System/Process/ServerInotify.php +++ b/System/Process/ServerInotify.php @@ -183,14 +183,14 @@ class ServerInotify extends Process */ public function clearWatch() { - try { - foreach ($this->watchFiles as $wd) { + foreach ($this->watchFiles as $wd) { + try { @inotify_rm_watch($this->inotify, $wd); + } catch (Exception $exception) { + $this->debug($exception->getMessage()); + } finally { + $this->watchFiles = []; } - } catch (Exception $exception) { - $this->debug($exception->getMessage()); - } finally { - $this->watchFiles = []; } }