Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

refactoring

Chris Lu05d27741179b
diff --git a/weed/command/filer_remote_sync.go b/weed/command/filer_remote_sync.go
index db5ce8b90e..48713093e8 100644
--- a/weed/command/filer_remote_sync.go
+++ b/weed/command/filer_remote_sync.go
@@ -73,13 +73,6 @@ func runFilerRemoteSynchronize(cmd *Command, args []string) bool {
dir := *remoteSyncOptions.dir
filerAddress := *remoteSyncOptions.filerAddress
- // read filer remote storage mount mappings
- _, _, remoteStorageMountLocation, storageConf, detectErr := filer.DetectMountInfo(grpcDialOption, filerAddress, dir)
- if detectErr != nil {
- fmt.Printf("read mount info: %v", detectErr)
- return false
- }
-
filerSource := &source.FilerSource{}
filerSource.DoInitialize(
filerAddress,
@@ -90,7 +83,7 @@ func runFilerRemoteSynchronize(cmd *Command, args []string) bool {
fmt.Printf("synchronize %s to remote storage...\n", dir)
util.RetryForever("filer.remote.sync "+dir, func() error {
- return followUpdatesAndUploadToRemote(&remoteSyncOptions, filerSource, dir, storageConf, remoteStorageMountLocation)
+ return followUpdatesAndUploadToRemote(&remoteSyncOptions, filerSource, dir)
}, func(err error) bool {
if err != nil {
glog.Errorf("synchronize %s: %v", dir, err)
@@ -101,7 +94,13 @@ func runFilerRemoteSynchronize(cmd *Command, args []string) bool {
return true
}
-func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *source.FilerSource, mountedDir string, remoteStorage *remote_pb.RemoteConf, remoteStorageMountLocation *remote_pb.RemoteStorageLocation) error {
+func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *source.FilerSource, mountedDir string) error {
+
+ // read filer remote storage mount mappings
+ _, _, remoteStorageMountLocation, remoteStorage, detectErr := filer.DetectMountInfo(option.grpcDialOption, *option.filerAddress, mountedDir)
+ if detectErr != nil {
+ return fmt.Errorf("read mount info: %v", detectErr)
+ }
dirHash := util.HashStringToLong(mountedDir)