Skip to content

Commit e35e6fd

Browse files
committed
Refactor file watcher
1 parent e3553d7 commit e35e6fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/watcher/file/file_watcher_service.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ func (fws *FileWatcherService) addWatcher(ctx context.Context, directory string)
202202
ctx, "Unable to watch directory that does not exist",
203203
"directory", directory, "error", err,
204204
)
205+
206+
removeError := fws.watcher.Remove(directory)
207+
if removeError != nil {
208+
slog.ErrorContext(ctx, "Failed to remove file watcher", "directory_path", directory, "error", removeError)
209+
}
205210
}
206211

207212
slog.DebugContext(ctx, "Adding watcher", "directory", directory)

0 commit comments

Comments
 (0)