This commit is contained in:
xl
2024-11-18 16:50:22 +08:00
parent 4172349872
commit e46ad90c46
+3 -4
View File
@@ -137,9 +137,8 @@ class HotReload extends AbstractProcess
*/ */
protected function clear(): void protected function clear(): void
{ {
var_dump($this->watches); foreach ($this->watches as $watch) {
foreach ($this->watches as $key => $watch) { @inotify_rm_watch($this->pipe, $watch);
@inotify_rm_watch($this->pipe, $key);
} }
$this->watches = []; $this->watches = [];
} }
@@ -153,7 +152,7 @@ class HotReload extends AbstractProcess
if (str_ends_with($directory, '.php') === true) { if (str_ends_with($directory, '.php') === true) {
$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);
$this->watches[$wd] = $directory; $this->watches[] = $wd;
} }
} }