Skip to content

Commit 5b46225

Browse files
committed
Refactor file watcher
1 parent e35e6fd commit 5b46225

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/watcher/file/file_watcher_service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,22 +205,22 @@ func (fws *FileWatcherService) addWatcher(ctx context.Context, directory string)
205205

206206
removeError := fws.watcher.Remove(directory)
207207
if removeError != nil {
208-
slog.ErrorContext(ctx, "Failed to remove file watcher", "directory_path", directory, "error", removeError)
208+
slog.WarnContext(ctx, "Failed to remove file watcher", "directory_path", directory, "error", removeError)
209209
}
210210
}
211211

212212
slog.DebugContext(ctx, "Adding watcher", "directory", directory)
213213

214214
if err := fws.watcher.Add(directory); err != nil {
215-
slog.ErrorContext(ctx, "Failed to add file watcher", "directory", directory, "error", err)
215+
slog.WarnContext(ctx, "Failed to add file watcher", "directory", directory, "error", err)
216216
}
217217
}
218218

219219
func (fws *FileWatcherService) removeWatcher(ctx context.Context, path string) {
220220
slog.DebugContext(ctx, "Removing watcher", "directory", path)
221221
err := fws.watcher.Remove(path)
222222
if err != nil {
223-
slog.ErrorContext(ctx, "Failed to remove file watcher", "directory_path", path, "error", err)
223+
slog.WarnContext(ctx, "Failed to remove file watcher", "directory_path", path, "error", err)
224224
return
225225
}
226226
}

0 commit comments

Comments
 (0)