Browse Source

use append time instead of filer's own modification time

fix https://github.com/chrislusf/seaweedfs/issues/1669
pull/1681/head
Chris Lu 4 years ago
parent
commit
d986c7196d
  1. 2
      weed/storage/volume_read_write.go

2
weed/storage/volume_read_write.go

@ -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

Loading…
Cancel
Save