From 0b00edfc3b3291d97bd699adfc5ad15b69dd9947 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 21 May 2021 02:09:22 -0700 Subject: [PATCH] waits in case master lost connection --- weed/wdclient/masterclient.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go index e39b9dfdf..da812dc22 100644 --- a/weed/wdclient/masterclient.go +++ b/weed/wdclient/masterclient.go @@ -36,6 +36,9 @@ 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) + } return mc.currentMaster }