Browse Source

re-ordering

pull/2321/head
Chris Lu 3 years ago
parent
commit
16a342eb8a
  1. 27
      weed/command/filer_remote_sync.go

27
weed/command/filer_remote_sync.go

@ -93,17 +93,8 @@ func runFilerRemoteSynchronize(cmd *Command, args []string) bool {
*remoteSyncOptions.readChunkFromFiler, *remoteSyncOptions.readChunkFromFiler,
) )
if dir != "" {
fmt.Printf("synchronize %s to remote storage...\n", dir)
util.RetryForever("filer.remote.sync "+dir, func() error {
return followUpdatesAndUploadToRemote(&remoteSyncOptions, filerSource, dir)
}, func(err error) bool {
if err != nil {
glog.Errorf("synchronize %s: %v", dir, err)
}
return true
})
}
storageName := *remoteSyncOptions.createBucketAt
if storageName != "" {
remoteSyncOptions.bucketsDir = "/buckets" remoteSyncOptions.bucketsDir = "/buckets"
// check buckets again // check buckets again
@ -116,8 +107,6 @@ func runFilerRemoteSynchronize(cmd *Command, args []string) bool {
return nil return nil
}) })
storageName := *remoteSyncOptions.createBucketAt
if storageName != "" {
fmt.Printf("synchronize %s, default new bucket creation in %s ...\n", remoteSyncOptions.bucketsDir, storageName) fmt.Printf("synchronize %s, default new bucket creation in %s ...\n", remoteSyncOptions.bucketsDir, storageName)
util.RetryForever("filer.remote.sync buckets "+storageName, func() error { util.RetryForever("filer.remote.sync buckets "+storageName, func() error {
return remoteSyncOptions.followBucketUpdatesAndUploadToRemote(filerSource) return remoteSyncOptions.followBucketUpdatesAndUploadToRemote(filerSource)
@ -129,5 +118,17 @@ func runFilerRemoteSynchronize(cmd *Command, args []string) bool {
}) })
} }
if dir != "" {
fmt.Printf("synchronize %s to remote storage...\n", dir)
util.RetryForever("filer.remote.sync "+dir, func() error {
return followUpdatesAndUploadToRemote(&remoteSyncOptions, filerSource, dir)
}, func(err error) bool {
if err != nil {
glog.Errorf("synchronize %s: %v", dir, err)
}
return true
})
}
return true return true
} }
Loading…
Cancel
Save