diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-08-15 01:53:46 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-08-15 01:53:46 -0700 |
| commit | 9462f5129a8c6c66200150b41ddfe96a3dd0454e (patch) | |
| tree | 76c1782fe91d0d6adcb63a6435d217d48fd85f78 /weed/shell/command_remote_cache.go | |
| parent | 3ada61c875158dedd24618013da01939cc7acc07 (diff) | |
| download | seaweedfs-9462f5129a8c6c66200150b41ddfe96a3dd0454e.tar.xz seaweedfs-9462f5129a8c6c66200150b41ddfe96a3dd0454e.zip | |
shell: add "remote.meta.sync"
Diffstat (limited to 'weed/shell/command_remote_cache.go')
| -rw-r--r-- | weed/shell/command_remote_cache.go | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/weed/shell/command_remote_cache.go b/weed/shell/command_remote_cache.go index 4e19b6a99..21c479258 100644 --- a/weed/shell/command_remote_cache.go +++ b/weed/shell/command_remote_cache.go @@ -7,7 +7,6 @@ import ( "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/util" "io" - "strings" ) func init() { @@ -53,33 +52,9 @@ func (c *commandRemoteCache) Do(args []string, commandEnv *CommandEnv, writer io return nil } - mappings, listErr := filer.ReadMountMappings(commandEnv.option.GrpcDialOption, commandEnv.option.FilerAddress) - if listErr != nil { - return listErr - } - if *dir == "" { - jsonPrintln(writer, mappings) - fmt.Fprintln(writer, "need to specify '-dir' option") - return nil - } - - var localMountedDir string - var remoteStorageMountedLocation *filer_pb.RemoteStorageLocation - for k, loc := range mappings.Mappings { - if strings.HasPrefix(*dir, k) { - localMountedDir, remoteStorageMountedLocation = k, loc - } - } - if localMountedDir == "" { - jsonPrintln(writer, mappings) - fmt.Fprintf(writer, "%s is not mounted\n", *dir) - return nil - } - - // find remote storage configuration - remoteStorageConf, err := filer.ReadRemoteStorageConf(commandEnv.option.GrpcDialOption, commandEnv.option.FilerAddress, remoteStorageMountedLocation.Name) - if err != nil { - return err + localMountedDir, remoteStorageMountedLocation, remoteStorageConf, detectErr := detectMountInfo(commandEnv, writer, *dir) + if detectErr != nil{ + return detectErr } // pull content from remote |
