From d986c7196d96d2c6007f74f599d7809133d8915f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 11 Dec 2020 16:55:18 -0800 Subject: [PATCH] use append time instead of filer's own modification time fix https://github.com/chrislusf/seaweedfs/issues/1669 --- weed/storage/volume_read_write.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/storage/volume_read_write.go b/weed/storage/volume_read_write.go index c30abf237..f28ee50e6 100644 --- a/weed/storage/volume_read_write.go +++ b/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