From b54d956a2da7da0388a8f640921b3e7738264a3e Mon Sep 17 00:00:00 2001 From: xl Date: Mon, 18 Nov 2024 12:22:49 +0800 Subject: [PATCH] eee --- Abstracts/HotReload.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Abstracts/HotReload.php b/Abstracts/HotReload.php index a3294c4..a9842c7 100644 --- a/Abstracts/HotReload.php +++ b/Abstracts/HotReload.php @@ -70,20 +70,18 @@ class HotReload extends AbstractProcess public function process(Process|null $process): void { $this->pipe = inotify_init(); + foreach (config('reload.listen') as $value) { - $this->readFile($value); + $this->readDirectory($value); } while (!$this->isStop()) { $read = inotify_read($this->pipe); - var_dump($read); - if (count($read) > 0) { - $this->reload(); - - foreach (config('reload.listen') as $value) { - $this->reWatch($value); - } + foreach ($read as $item) { + $this->reWatch($this->watches[$item['wd']]); } + + $this->reload(); } }