This commit is contained in:
xl
2024-11-18 13:40:23 +08:00
parent e0eda4b42c
commit f858cecf1a
+4 -2
View File
@@ -78,7 +78,7 @@ class HotReload extends AbstractProcess
$read = inotify_read($this->pipe); $read = inotify_read($this->pipe);
foreach ($read as $item) { foreach ($read as $item) {
$this->reWatch($this->watches[$item['mask']]); $this->reWatch($this->watches[$item['wd']]);
} }
$this->reload(); $this->reload();
@@ -119,7 +119,7 @@ class HotReload extends AbstractProcess
/** /**
* @param string $directory * @param int $directory
* @return void * @return void
*/ */
public function reWatch(int $directory): void public function reWatch(int $directory): void
@@ -129,6 +129,8 @@ class HotReload extends AbstractProcess
$wd = inotify_add_watch($this->pipe, $directory, IN_MODIFY | IN_MOVE | IN_CREATE | IN_DELETE); $wd = inotify_add_watch($this->pipe, $directory, IN_MODIFY | IN_MOVE | IN_CREATE | IN_DELETE);
var_dump($wd);
$this->watches[$wd] = $directory; $this->watches[$wd] = $directory;
} }
} }