fix a regression with truncation detection
This commit is contained in:
parent
de27e252a7
commit
68dffd22b4
|
@ -107,6 +107,7 @@ func (fw *InotifyFileWatcher) ChangeEvents(t tomb.Tomb, fi os.FileInfo) *FileCha
|
||||||
}else{
|
}else{
|
||||||
changes.NotifyModified()
|
changes.NotifyModified()
|
||||||
}
|
}
|
||||||
|
prevSize = fw.Size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -80,8 +80,10 @@ func (fw *PollingFileWatcher) ChangeEvents(t tomb.Tomb, origFi os.FileInfo) *Fil
|
||||||
fw.Size = fi.Size()
|
fw.Size = fi.Size()
|
||||||
if prevSize > 0 && prevSize > fw.Size {
|
if prevSize > 0 && prevSize > fw.Size {
|
||||||
changes.NotifyTruncated()
|
changes.NotifyTruncated()
|
||||||
|
prevSize = fw.Size
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
prevSize = fw.Size
|
||||||
|
|
||||||
// File was appended to (changed)?
|
// File was appended to (changed)?
|
||||||
modTime := fi.ModTime()
|
modTime := fi.ModTime()
|
||||||
|
|
Loading…
Reference in New Issue