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():
|
||||
fi, err := os.Stat(fw.Filename)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
changes.NotifyDeleted()
|
||||
return
|
||||
}
|
||||
// XXX: no panic here
|
||||
panic(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue