Skip to content

Commit

Permalink
refactor: Make fsnotify event more readable. (argoproj#11836)
Browse files Browse the repository at this point in the history
Signed-off-by: yanggang <gang.yang@daocloud.io>

Signed-off-by: yanggang <gang.yang@daocloud.io>
Signed-off-by: schakrad <chakradari.sindhu@gmail.com>
  • Loading branch information
杨刚 authored and schakrad committed Mar 14, 2023
1 parent fbb29b0 commit 38593be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reposerver/gpgwatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ func StartGPGWatcher(sourcePath string) error {
if !ok {
return
}
if event.Op&fsnotify.Create == fsnotify.Create || event.Op&fsnotify.Remove == fsnotify.Remove {
if event.Has(fsnotify.Create) || event.Has(fsnotify.Remove) {
// In case our watched path is re-created (i.e. during e2e tests), we need to watch again
// For more robustness, we retry re-creating the watcher up to maxRecreateRetries
if event.Name == sourcePath && event.Op&fsnotify.Remove == fsnotify.Remove {
if event.Name == sourcePath && event.Has(fsnotify.Remove) {
log.Warnf("Re-creating watcher on %s", sourcePath)
attempt := 0
for {
Expand Down

0 comments on commit 38593be

Please sign in to comment.