release filewatcher channels

This commit is contained in:
yusing 2025-01-03 03:08:42 +08:00
parent ba8705fb84
commit 4819972399

View file

@ -88,6 +88,10 @@ func (h *DirWatcher) cleanup() {
h.w.Close() h.w.Close()
close(h.eventCh) close(h.eventCh)
close(h.errCh) close(h.errCh)
h.fwMap.RangeAll(func(key string, fw *fileWatcher) {
close(fw.eventCh)
close(fw.errCh)
})
h.task.Finish(nil) h.task.Finish(nil)
} }