Skip to content

Commit 5ced7e1

Browse files
committed
add paranoid reset
1 parent 0cbee38 commit 5ced7e1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

agent/agentcontainers/watcher/watcher.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ func (f *fsnotifyWatcher) Remove(file string) error {
116116
// If no more files in this directory are being watched, stop
117117
// watching the directory.
118118
if f.watchedDirs[dir] <= 0 {
119+
f.watchedDirs[dir] = 0 // Ensure non-negative count.
119120
if err := f.Watcher.Remove(dir); err != nil {
120121
return xerrors.Errorf("remove directory from watcher: %w", err)
121122
}

0 commit comments

Comments
 (0)