aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_remote_meta_sync.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-29 18:41:29 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-29 18:41:29 -0700
commit001a472057f01b3ac2d3edb59b3d5fb0a141cddd (patch)
treeb9bac6f68ab44cb2d0fee5df0db69ba589ff69b0 /weed/shell/command_remote_meta_sync.go
parent05d27741179b199608d0c5c5373bf3c8939c1697 (diff)
downloadseaweedfs-001a472057f01b3ac2d3edb59b3d5fb0a141cddd.tar.xz
seaweedfs-001a472057f01b3ac2d3edb59b3d5fb0a141cddd.zip
cloud mount: remote storage support hdfs
Diffstat (limited to 'weed/shell/command_remote_meta_sync.go')
-rw-r--r--weed/shell/command_remote_meta_sync.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/shell/command_remote_meta_sync.go b/weed/shell/command_remote_meta_sync.go
index b4e3534fc..17b9abdb8 100644
--- a/weed/shell/command_remote_meta_sync.go
+++ b/weed/shell/command_remote_meta_sync.go
@@ -55,7 +55,7 @@ func (c *commandRemoteMetaSync) Do(args []string, commandEnv *CommandEnv, writer
}
mappings, localMountedDir, remoteStorageMountedLocation, remoteStorageConf, detectErr := detectMountInfo(commandEnv, writer, *dir)
- if detectErr != nil{
+ if detectErr != nil {
jsonPrintln(writer, mappings)
return detectErr
}
@@ -106,7 +106,7 @@ func detectMountInfo(commandEnv *CommandEnv, writer io.Writer, dir string) (*rem
If entry.RemoteEntry.RemoteTag != remoteEntry.RemoteTag {
the remote version is updated, need to pull meta
}
- */
+*/
func pullMetadata(commandEnv *CommandEnv, writer io.Writer, localMountedDir util.FullPath, remoteMountedLocation *remote_pb.RemoteStorageLocation, dirToCache util.FullPath, remoteConf *remote_pb.RemoteConf) error {
// visit remote storage
@@ -158,7 +158,7 @@ func pullMetadata(commandEnv *CommandEnv, writer io.Writer, localMountedDir util
fmt.Fprintln(writer, " (skip)")
return nil
}
- if existingEntry.RemoteEntry.RemoteETag != remoteEntry.RemoteETag {
+ if existingEntry.RemoteEntry.RemoteETag != remoteEntry.RemoteETag || existingEntry.RemoteEntry.RemoteMtime < remoteEntry.RemoteMtime {
// the remote version is updated, need to pull meta
fmt.Fprintln(writer, " (update)")
return doSaveRemoteEntry(client, string(localDir), existingEntry, remoteEntry)