diff options
| author | Jonathan Amsterdam <jba@google.com> | 2019-03-20 16:02:38 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2019-03-20 16:02:38 -0400 |
| commit | e966033098ce13fdda97dd96b309357bd410d8d6 (patch) | |
| tree | dd401620f393d366e6c6ab80c15589eadfa2aea2 /weed/wdclient/masterclient.go | |
| parent | 8db82e2b75eb67bc58a4869cc70fb8c5b2c0b97c (diff) | |
| parent | 977b30e992108e480c883cdd461bf0c8f6598f25 (diff) | |
| download | seaweedfs-e966033098ce13fdda97dd96b309357bd410d8d6.tar.xz seaweedfs-e966033098ce13fdda97dd96b309357bd410d8d6.zip | |
Merge branch 'master' of https://github.com/chrislusf/seaweedfs into gocdk
Diffstat (limited to 'weed/wdclient/masterclient.go')
| -rw-r--r-- | weed/wdclient/masterclient.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go index b3b277c74..794471f7b 100644 --- a/weed/wdclient/masterclient.go +++ b/weed/wdclient/masterclient.go @@ -101,7 +101,7 @@ func (mc *MasterClient) tryAllMasters() { func withMasterClient(ctx context.Context, master string, grpcDialOption grpc.DialOption, fn func(ctx context.Context, client master_pb.SeaweedClient) error) error { - masterGrpcAddress, parseErr := util.ParseServerToGrpcAddress(master, 0) + masterGrpcAddress, parseErr := util.ParseServerToGrpcAddress(master) if parseErr != nil { return fmt.Errorf("failed to parse master grpc %v", master) } @@ -116,3 +116,9 @@ func withMasterClient(ctx context.Context, master string, grpcDialOption grpc.Di return fn(ctx, client) } + +func (mc *MasterClient) WithClient(ctx context.Context, fn func(client master_pb.SeaweedClient) error) error { + return withMasterClient(ctx, mc.currentMaster, mc.grpcDialOption, func(ctx context.Context, client master_pb.SeaweedClient) error { + return fn(client) + }) +} |
