diff options
| author | chrislu <chris.lu@gmail.com> | 2024-08-08 21:25:52 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-08-08 21:25:52 -0700 |
| commit | e069009f09b6ff73cf3c8359a10a73372c530c59 (patch) | |
| tree | fd74e3852c66f29c858a172f6ef3ba7a680fe5f0 | |
| parent | 9ca30e52d59fe6942435d55b84632e3b9ddda27e (diff) | |
| download | seaweedfs-e069009f09b6ff73cf3c8359a10a73372c530c59.tar.xz seaweedfs-e069009f09b6ff73cf3c8359a10a73372c530c59.zip | |
[remote.cache, remote.uncache] fix min/max age
fix https://github.com/seaweedfs/seaweedfs/issues/5871
| -rw-r--r-- | weed/shell/command_remote_uncache.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/shell/command_remote_uncache.go b/weed/shell/command_remote_uncache.go index 34269ce4e..f5ec8934c 100644 --- a/weed/shell/command_remote_uncache.go +++ b/weed/shell/command_remote_uncache.go @@ -7,6 +7,7 @@ import ( "io" "path/filepath" "strings" + "time" "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" @@ -164,12 +165,12 @@ func (ff *FileFilter) matches(entry *filer_pb.Entry) bool { } } if *ff.minAge != -1 { - if entry.Attributes.Crtime < *ff.minAge { + if entry.Attributes.Crtime + *ff.minAge < time.Now().Unix() { return false } } if *ff.maxAge != -1 { - if entry.Attributes.Crtime > *ff.maxAge { + if entry.Attributes.Crtime + *ff.maxAge > time.Now().Unix() { return false } } |
