From f4f48ebad7ad942730f06670bd2fb8fc3bc64f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 19 Nov 2021 18:21:59 +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 --- kiri-engine/FileListen/Inotify.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kiri-engine/FileListen/Inotify.php b/kiri-engine/FileListen/Inotify.php index 5ed4c275..5e7e8c6e 100644 --- a/kiri-engine/FileListen/Inotify.php +++ b/kiri-engine/FileListen/Inotify.php @@ -51,10 +51,10 @@ class Inotify } - /** - * 开始监听 - * @throws Exception - */ + /** + * 开始监听 + * @throws Exception + */ public function check() { if (!($events = inotify_read($this->inotify))) { @@ -73,7 +73,7 @@ class Inotify } //非重启类型 if (str_ends_with($ev['name'], '.php')) { - sleep(2); + sleep(2); $this->reload(); } } @@ -84,6 +84,9 @@ class Inotify */ public function reload() { + if ($this->process->isReloading) { + return; + } $this->process->isReloading = true; $this->process->trigger_reload(); $this->clearWatch();