diff options
| author | chrislu <chris.lu@gmail.com> | 2023-03-21 23:01:49 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2023-03-21 23:01:49 -0700 |
| commit | 5db9fcccd4194660a8503696ac44c3539c29d41e (patch) | |
| tree | 9c2afed1dcfb5b958208fbc095919152eb32fc7d /weed/command/filer_remote_sync_dir.go | |
| parent | de4545c28b8283fb80ae03dc95910a0ab3a67142 (diff) | |
| download | seaweedfs-5db9fcccd4194660a8503696ac44c3539c29d41e.tar.xz seaweedfs-5db9fcccd4194660a8503696ac44c3539c29d41e.zip | |
refactoring
Diffstat (limited to 'weed/command/filer_remote_sync_dir.go')
| -rw-r--r-- | weed/command/filer_remote_sync_dir.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go index 5bc6ae300..1dc91b5d5 100644 --- a/weed/command/filer_remote_sync_dir.go +++ b/weed/command/filer_remote_sync_dir.go @@ -63,8 +63,21 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sour lastOffsetTs := collectLastSyncOffset(option, option.grpcDialOption, pb.ServerAddress(*option.filerAddress), mountedDir, *option.timeAgo) option.clientEpoch++ - return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, "filer.remote.sync", option.clientId, option.clientEpoch, - mountedDir, []string{filer.DirectoryEtcRemote}, lastOffsetTs.UnixNano(), 0, 0, processEventFnWithOffset, pb.TrivialOnError) + + metadataFollowOption := &pb.MetadataFollowOption{ + ClientName: "filer.remote.sync", + ClientId: option.clientId, + ClientEpoch: option.clientEpoch, + SelfSignature: 0, + PathPrefix: mountedDir, + AdditionalPathPrefixes: []string{filer.DirectoryEtcRemote}, + DirectoriesToWatch: nil, + StartTsNs: lastOffsetTs.UnixNano(), + StopTsNs: 0, + EventErrorType: pb.TrivialOnError, + } + + return pb.FollowMetadata(pb.ServerAddress(*option.filerAddress), option.grpcDialOption, metadataFollowOption, processEventFnWithOffset) } func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string, remoteStorageMountLocation *remote_pb.RemoteStorageLocation, filerSource *source.FilerSource) (pb.ProcessMetadataFunc, error) { |
