rename, fix wrong logic.

This commit is contained in:
Chris Lu
2021-08-14 21:46:34 -07:00
parent cb53802752
commit c34747c79d
8 changed files with 560 additions and 549 deletions

View File

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