diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-09-12 22:47:52 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-09-12 22:47:52 -0700 |
| commit | e5fc35ed0c970fea060a5b3b7a3f5efb5af425d6 (patch) | |
| tree | 3ad0436940263a24ac46d38a60dd1e35b2c1cdfe /weed/command/filer_remote_sync_dir.go | |
| parent | 2c9d4c8f43c1e95c75fc332ca83d19e33e5da3ac (diff) | |
| download | seaweedfs-e5fc35ed0c970fea060a5b3b7a3f5efb5af425d6.tar.xz seaweedfs-e5fc35ed0c970fea060a5b3b7a3f5efb5af425d6.zip | |
change server address from string to a type
Diffstat (limited to 'weed/command/filer_remote_sync_dir.go')
| -rw-r--r-- | weed/command/filer_remote_sync_dir.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go index dc2e9a1fb..50f1e35cf 100644 --- a/weed/command/filer_remote_sync_dir.go +++ b/weed/command/filer_remote_sync_dir.go @@ -20,7 +20,7 @@ import ( 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) + _, _, remoteStorageMountLocation, remoteStorage, detectErr := filer.DetectMountInfo(option.grpcDialOption, pb.ServerAddress(*option.filerAddress), mountedDir) if detectErr != nil { return fmt.Errorf("read mount info: %v", detectErr) } @@ -33,12 +33,12 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sour processEventFnWithOffset := pb.AddOffsetFunc(eachEntryFunc, 3*time.Second, func(counter int64, lastTsNs int64) error { lastTime := time.Unix(0, lastTsNs) glog.V(0).Infof("remote sync %s progressed to %v %0.2f/sec", *option.filerAddress, lastTime, float64(counter)/float64(3)) - return remote_storage.SetSyncOffset(option.grpcDialOption, *option.filerAddress, mountedDir, lastTsNs) + return remote_storage.SetSyncOffset(option.grpcDialOption, pb.ServerAddress(*option.filerAddress), mountedDir, lastTsNs) }) lastOffsetTs := collectLastSyncOffset(option, mountedDir) - return pb.FollowMetadata(*option.filerAddress, option.grpcDialOption, "filer.remote.sync", + return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, "filer.remote.sync", mountedDir, []string{filer.DirectoryEtcRemote}, lastOffsetTs.UnixNano(), 0, processEventFnWithOffset, false) } @@ -171,7 +171,7 @@ func collectLastSyncOffset(option *RemoteSyncOptions, mountedDir string) time.Ti return time.Now() } - lastOffsetTsNs, err := remote_storage.GetSyncOffset(option.grpcDialOption, *option.filerAddress, mountedDir) + lastOffsetTsNs, err := remote_storage.GetSyncOffset(option.grpcDialOption, pb.ServerAddress(*option.filerAddress), mountedDir) if mountedDirEntry != nil { if err == nil && mountedDirEntry.Attributes.Crtime < lastOffsetTsNs/1000000 { lastOffsetTs = time.Unix(0, lastOffsetTsNs) |
