backend: Check file error
This commit is contained in:
parent
32d003f7b7
commit
7b300d4ffe
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user