aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-12-11 16:55:18 -0800
committerChris Lu <chris.lu@gmail.com>2020-12-11 16:55:18 -0800
commitd986c7196d96d2c6007f74f599d7809133d8915f (patch)
tree7cf63e9ab98fc0829061a99582478ffc9a7dd508
parent3fedfec1e728e84120caa636b7d0d3da0fcffbc4 (diff)
downloadseaweedfs-d986c7196d96d2c6007f74f599d7809133d8915f.tar.xz
seaweedfs-d986c7196d96d2c6007f74f599d7809133d8915f.zip
use append time instead of filer's own modification time
fix https://github.com/chrislusf/seaweedfs/issues/1669
-rw-r--r--weed/storage/volume_read_write.go2
1 files changed, 1 insertions, 1 deletions
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