aboutsummaryrefslogtreecommitdiff
path: root/weed/replication/source/filer_source.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-01-20 01:48:12 -0800
committerchrislu <chris.lu@gmail.com>2023-01-20 01:48:12 -0800
commit81fdf3651b1f60642fc15bd2b55ed0bd31afac15 (patch)
tree19129015db907153d6aa89058c621e2bf93a6bae /weed/replication/source/filer_source.go
parentb04865974905c2b31eb23b966df6386172e5ba50 (diff)
downloadseaweedfs-81fdf3651b1f60642fc15bd2b55ed0bd31afac15.tar.xz
seaweedfs-81fdf3651b1f60642fc15bd2b55ed0bd31afac15.zip
grpc connection to filer add sw-client-id header
Diffstat (limited to 'weed/replication/source/filer_source.go')
-rw-r--r--weed/replication/source/filer_source.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/replication/source/filer_source.go b/weed/replication/source/filer_source.go
index 2da883ba6..167907a5a 100644
--- a/weed/replication/source/filer_source.go
+++ b/weed/replication/source/filer_source.go
@@ -28,10 +28,12 @@ type FilerSource struct {
address string
proxyByFiler bool
dataCenter string
+ signature int32
}
func (fs *FilerSource) Initialize(configuration util.Configuration, prefix string) error {
fs.dataCenter = configuration.GetString(prefix + "dataCenter")
+ fs.signature = util.RandomInt32()
return fs.DoInitialize(
"",
configuration.GetString(prefix+"grpcAddress"),
@@ -128,7 +130,7 @@ var _ = filer_pb.FilerClient(&FilerSource{})
func (fs *FilerSource) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
- return pb.WithGrpcClient(streamingMode, func(grpcConnection *grpc.ClientConn) error {
+ return pb.WithGrpcClient(streamingMode, fs.signature, func(grpcConnection *grpc.ClientConn) error {
client := filer_pb.NewSeaweedFilerClient(grpcConnection)
return fn(client)
}, fs.grpcAddress, false, fs.grpcDialOption)