From 8a1e001cab9001c69dedbe665eade7e6d50ed21a Mon Sep 17 00:00:00 2001 From: as2252258 Date: Fri, 29 Apr 2022 17:06:34 +0800 Subject: [PATCH] modify mysql result --- Inotify.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Inotify.php b/Inotify.php index 080a33f..7670fe3 100644 --- a/Inotify.php +++ b/Inotify.php @@ -97,15 +97,13 @@ class Inotify extends BaseProcess $this->watch($dir); } Event::add($this->inotify, [$this, 'check']); - while (true) { + Event::cycle(function () { if ($this->isStop()) { Event::del($this->inotify); - break; } - Event::dispatch(); - - usleep(100 * 1000); - } + Event::exit(); + }, true); + Event::wait(); }