From 9eb299c3ac08e2bea4dfe9e3355178566bcf0501 Mon Sep 17 00:00:00 2001 From: RanXom Date: Fri, 17 Jul 2026 00:36:31 +0530 Subject: refactor(watcher): isolate debounce loop --- internal/watcher/fsnotify.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/watcher/fsnotify.go') diff --git a/internal/watcher/fsnotify.go b/internal/watcher/fsnotify.go index 7251907..b759c50 100644 --- a/internal/watcher/fsnotify.go +++ b/internal/watcher/fsnotify.go @@ -22,6 +22,8 @@ func (w *Watcher) Run(ctx context.Context) error { _ = fswatcher.Close() }() + go w.debounceLoop(ctx) + for _, root := range w.config.Roots { if err := watchTree(fswatcher, root); err != nil { return err @@ -40,6 +42,8 @@ func (w *Watcher) Run(ctx context.Context) error { log.Printf("watcher: %v %s", event.Op, event.Name) + w.notify() + if !event.Has(fsnotify.Create) { continue } -- cgit v1.2.3