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 = []; } }