aboutsummaryrefslogtreecommitdiff
path: root/internal/watcher/fsnotify.go
diff options
context:
space:
mode:
authorRanXom <saiyedshizain@gmail.com>2026-07-17 00:36:31 +0530
committerRanXom <saiyedshizain@gmail.com>2026-07-17 00:36:31 +0530
commit9eb299c3ac08e2bea4dfe9e3355178566bcf0501 (patch)
treeeaf1922cf46b4ca9e22a45de2f07e59ea47f5ee1 /internal/watcher/fsnotify.go
parentd2c0c970f690d52ee3675f377a5eebc22f84afab (diff)
downloadgalleryd-9eb299c3ac08e2bea4dfe9e3355178566bcf0501.tar.xz
galleryd-9eb299c3ac08e2bea4dfe9e3355178566bcf0501.zip
refactor(watcher): isolate debounce loop
Diffstat (limited to 'internal/watcher/fsnotify.go')
-rw-r--r--internal/watcher/fsnotify.go4
1 files changed, 4 insertions, 0 deletions
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
}