Skip to content

Commit

Permalink
Add debug log for fsnotify remove and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
matoval committed Nov 14, 2024
1 parent 25ff7aa commit 9555da8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/workceptor/workunitbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,16 @@ loop:
if err != nil {
bwu.w.nc.GetLogger().Error("Watcher Events Error reading %s: %s", statusFile, err)
}
} else if event.Op&fsnotify.Remove == fsnotify.Remove {
err = bwu.Load()
if err != nil {
bwu.w.nc.GetLogger().Error("Watcher Events Remove reading %s: %s", statusFile, err)
}
} else if event.Op&fsnotify.Rename == fsnotify.Rename {
err = bwu.Load()
if err != nil {
bwu.w.nc.GetLogger().Error("Watcher Events Rename reading %s: %s", statusFile, err)
}

Check warning on line 451 in pkg/workceptor/workunitbase.go

View check run for this annotation

Codecov / codecov/patch

pkg/workceptor/workunitbase.go#L442-L451

Added lines #L442 - L451 were not covered by tests
}
case <-time.After(time.Second):
newFi, err := bwu.fs.Stat(statusFile)
Expand Down

0 comments on commit 9555da8

Please sign in to comment.