diff --git a/Abstracts/FileWatcher.php b/Abstracts/FileWatcher.php index 700758f..8bf537a 100644 --- a/Abstracts/FileWatcher.php +++ b/Abstracts/FileWatcher.php @@ -183,12 +183,12 @@ class FileWatcher extends AbstractProcess implements OnProcessInterface $this->fswatchPipes = []; $this->stopFswatchProcess(); - if ($this->pollTimer) { + if ($this->pollTimer > 0) { Timer::clear($this->pollTimer); $this->pollTimer = -1; } - if ($this->debounceTimer) { + if ($this->debounceTimer > 0) { Timer::clear($this->debounceTimer); $this->debounceTimer = -1; } @@ -267,7 +267,7 @@ class FileWatcher extends AbstractProcess implements OnProcessInterface return; } - if ($this->debounceTimer) { + if ($this->debounceTimer > 0) { Timer::clear($this->debounceTimer); } @@ -276,7 +276,7 @@ class FileWatcher extends AbstractProcess implements OnProcessInterface $delay = max($this->debounceMs, $this->minReloadIntervalMs - $elapsed); $this->debounceTimer = Timer::after($delay, function () use ($changedFiles) { - $this->debounceTimer = null; + $this->debounceTimer = -1; $this->reload($changedFiles); }); }