From ef3ea8c7a43490749459859cbdb9aaa7f8646d6b Mon Sep 17 00:00:00 2001 From: as2252258 Date: Fri, 29 Apr 2022 16:51:27 +0800 Subject: [PATCH] modify mysql result --- Inotify.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Inotify.php b/Inotify.php index a2bb444..0849dc4 100644 --- a/Inotify.php +++ b/Inotify.php @@ -96,17 +96,15 @@ class Inotify extends BaseProcess $this->watch($dir); } Event::add($this->inotify, [$this, 'check']); + Event::cycle(function () { + Event::del($this->inotify); + }); Event::wait(); } public function clear() { - if (is_null($this->inotify)) { - return; - } - Event::del($this->inotify); - Event::exit(); }