use append time instead of filer's own modification time

fix https://github.com/chrislusf/seaweedfs/issues/1669
This commit is contained in:
Chris Lu 2020-12-11 16:55:18 -08:00
parent 3fedfec1e7
commit d986c7196d

View file

@ -322,7 +322,7 @@ func (v *Volume) readNeedle(n *needle.Needle, readOption *ReadOption) (int, erro
if !n.HasLastModifiedDate() {
return bytesRead, nil
}
if uint64(time.Now().Unix()) < n.LastModified+uint64(ttlMinutes*60) {
if time.Now().Before(time.Unix(0, int64(n.AppendAtNs)).Add(time.Duration(ttlMinutes) * time.Minute)) {
return bytesRead, nil
}
return -1, ErrorNotFound