Merge pull request #17 from presbrey/patch-1
fix race/panic on modify+delete
This commit is contained in:
commit
c9444e81ae
|
@ -97,6 +97,10 @@ func (fw *InotifyFileWatcher) ChangeEvents(t tomb.Tomb, fi os.FileInfo) *FileCha
|
||||||
case evt.IsModify():
|
case evt.IsModify():
|
||||||
fi, err := os.Stat(fw.Filename)
|
fi, err := os.Stat(fw.Filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
changes.NotifyDeleted()
|
||||||
|
return
|
||||||
|
}
|
||||||
// XXX: no panic here
|
// XXX: no panic here
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue