backend: Check file error
Some checks failed
continuous-integration/drone/tag Build is failing
continuous-integration/drone/push Build is failing

This commit is contained in:
nemunaire 2022-06-08 17:13:41 +02:00
parent 32d003f7b7
commit 7b300d4ffe

View File

@ -181,15 +181,15 @@ func main() {
if err := watchsubdir(watcher, ev.Name); err != nil { if err := watchsubdir(watcher, ev.Name); err != nil {
log.Println(err) 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 { if *debugINotify {
log.Println("Treating event:", ev, "for", ev.Name) log.Println("Treating event:", ev, "for", ev.Name)
} }
go treat(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.") log.Println("FSNOTIFY WRITE SEEN. Prefer looking at them, as it appears files are not atomically moved.")
watchedNotify = fsnotify.Write watchedNotify = fsnotify.Write
} else if *debugINotify { } else if err == nil && *debugINotify {
log.Println("Skipped event:", ev, "for", ev.Name) log.Println("Skipped event:", ev, "for", ev.Name)
} }
case err := <-watcher.Errors: case err := <-watcher.Errors: