From c873466e5b33a5782e62ee25bafe31c92e636f21 Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 19 Nov 2025 20:24:13 -0500 Subject: [PATCH] fix(scanner): reset watcher trigger timer for debounce on notification receipt Signed-off-by: Deluan --- scanner/watcher.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scanner/watcher.go b/scanner/watcher.go index ad9a0642..3efebaac 100644 --- a/scanner/watcher.go +++ b/scanner/watcher.go @@ -122,6 +122,9 @@ func (w *watcher) Run(ctx context.Context) error { w.mu.Unlock() return nil case notification := <-w.watcherNotify: + // Reset the trigger timer for debounce + trigger.Reset(w.triggerWait) + lib := notification.Library folderPath := notification.FolderPath @@ -131,7 +134,6 @@ func (w *watcher) Run(ctx context.Context) error { continue } targets[target] = struct{}{} - trigger.Reset(w.triggerWait) log.Debug(ctx, "Watcher: Detected changes. Waiting for more changes before triggering scan", "libraryID", lib.ID, "name", lib.Name, "path", lib.Path, "folderPath", folderPath)