simplify a bit
This commit is contained in:
@@ -36,9 +36,7 @@ func NewMasterClient(grpcDialOption grpc.DialOption, clientType string, clientHo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mc *MasterClient) GetMaster() string {
|
func (mc *MasterClient) GetMaster() string {
|
||||||
for mc.currentMaster == "" {
|
mc.WaitUntilConnected()
|
||||||
time.Sleep(time.Duration(rand.Int31n(200)) * time.Millisecond)
|
|
||||||
}
|
|
||||||
return mc.currentMaster
|
return mc.currentMaster
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user