From e8b7d4ad64e47b7ca37aa4b2a8efc04f02a19a9b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 21 May 2021 02:10:44 -0700 Subject: [PATCH] simplify a bit --- weed/wdclient/masterclient.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go index da812dc22..d76ae31e2 100644 --- a/weed/wdclient/masterclient.go +++ b/weed/wdclient/masterclient.go @@ -36,9 +36,7 @@ func NewMasterClient(grpcDialOption grpc.DialOption, clientType string, clientHo } func (mc *MasterClient) GetMaster() string { - for mc.currentMaster == "" { - time.Sleep(time.Duration(rand.Int31n(200)) * time.Millisecond) - } + mc.WaitUntilConnected() return mc.currentMaster }