diff --git a/backend/main.go b/backend/main.go index 058a9642..50cb87cd 100644 --- a/backend/main.go +++ b/backend/main.go @@ -181,15 +181,15 @@ func main() { if err := watchsubdir(watcher, ev.Name); err != nil { log.Println(err) } - } else if ev.Op&watchedNotify == watchedNotify && d.Mode().IsRegular() { + } else if err == nil && ev.Op&watchedNotify == watchedNotify && d.Mode().IsRegular() { if *debugINotify { log.Println("Treating event:", ev, "for", ev.Name) } go treat(ev.Name) - } else if ev.Op&fsnotify.Write == fsnotify.Write { + } else if err == nil && ev.Op&fsnotify.Write == fsnotify.Write { log.Println("FSNOTIFY WRITE SEEN. Prefer looking at them, as it appears files are not atomically moved.") watchedNotify = fsnotify.Write - } else if *debugINotify { + } else if err == nil && *debugINotify { log.Println("Skipped event:", ev, "for", ev.Name) } case err := <-watcher.Errors: