From 4819972399a52cf45ea6b4bf824e25d1ee1a0b73 Mon Sep 17 00:00:00 2001 From: yusing Date: Fri, 3 Jan 2025 03:08:42 +0800 Subject: [PATCH] release filewatcher channels --- internal/watcher/directory_watcher.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/watcher/directory_watcher.go b/internal/watcher/directory_watcher.go index af8bceb..7408f3d 100644 --- a/internal/watcher/directory_watcher.go +++ b/internal/watcher/directory_watcher.go @@ -88,6 +88,10 @@ func (h *DirWatcher) cleanup() { h.w.Close() close(h.eventCh) close(h.errCh) + h.fwMap.RangeAll(func(key string, fw *fileWatcher) { + close(fw.eventCh) + close(fw.errCh) + }) h.task.Finish(nil) }