aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_remote_cache.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-14 21:46:34 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-14 21:46:34 -0700
commitc34747c79d99d8a08bea31b7339b17dca6fad44d (patch)
treec4c119eef25e06e778eff894ec258e607a0774b4 /weed/shell/command_remote_cache.go
parentcb53802752919fd91342927b401f8f66652c79ec (diff)
downloadseaweedfs-c34747c79d99d8a08bea31b7339b17dca6fad44d.tar.xz
seaweedfs-c34747c79d99d8a08bea31b7339b17dca6fad44d.zip
rename, fix wrong logic.
Diffstat (limited to 'weed/shell/command_remote_cache.go')
-rw-r--r--weed/shell/command_remote_cache.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/shell/command_remote_cache.go b/weed/shell/command_remote_cache.go
index 561484302..4e19b6a99 100644
--- a/weed/shell/command_remote_cache.go
+++ b/weed/shell/command_remote_cache.go
@@ -118,7 +118,7 @@ func shouldCacheToLocal(entry *filer_pb.Entry) bool {
if entry.RemoteEntry == nil {
return false
}
- if entry.RemoteEntry.LocalMtime < entry.Attributes.Mtime && entry.RemoteEntry.RemoteSize > 0 {
+ if entry.RemoteEntry.LastLocalSyncTsNs == 0 && entry.RemoteEntry.RemoteSize > 0 {
return true
}
return false
@@ -131,7 +131,7 @@ func mayHaveCachedToLocal(entry *filer_pb.Entry) bool {
if entry.RemoteEntry == nil {
return false // should not uncache an entry that is not in remote
}
- if entry.RemoteEntry.LocalMtime > 0 && len(entry.Chunks) > 0 {
+ if entry.RemoteEntry.LastLocalSyncTsNs > 0 && len(entry.Chunks) > 0 {
return true
}
return false