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