diff --git a/weed/server/filer_grpc_server_remote.go b/weed/server/filer_grpc_server_remote.go index 54e9445ce..97927e9c0 100644 --- a/weed/server/filer_grpc_server_remote.go +++ b/weed/server/filer_grpc_server_remote.go @@ -153,7 +153,7 @@ func (fs *FilerServer) DownloadToLocal(ctx context.Context, req *filer_pb.Downlo newEntry := entry.ShallowClone() newEntry.Chunks = chunks newEntry.Remote = proto.Clone(entry.Remote).(*filer_pb.RemoteEntry) - newEntry.Remote.LocalMtime = time.Now().Unix() + newEntry.Remote.LocalMtime = entry.Mtime.Unix() // this skips meta data log events diff --git a/weed/shell/command_remote_cache.go b/weed/shell/command_remote_cache.go index c74166611..8980fc82e 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 == 0 && entry.RemoteEntry.RemoteSize > 0 { + if entry.RemoteEntry.LocalMtime < entry.Attributes.Mtime && entry.RemoteEntry.RemoteSize > 0 { return true } return false