From ee1fc6558a6db603c4eaac9f3cee11873f934f56 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 16 Oct 2020 11:02:44 -0700 Subject: [PATCH] refactor --- weed/command/master.go | 2 +- weed/wdclient/masterclient.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/command/master.go b/weed/command/master.go index bf5f83875..74c170395 100644 --- a/weed/command/master.go +++ b/weed/command/master.go @@ -145,7 +145,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) { go func() { time.Sleep(1500 * time.Millisecond) if ms.Topo.RaftServer.Leader() == "" && ms.Topo.RaftServer.IsLogEmpty() && isTheFirstOne(myMasterAddress, peers) { - if ms.MasterClient.FindLeader(myMasterAddress) == "" { + if ms.MasterClient.FindLeaderFromOtherPeers(myMasterAddress) == "" { raftServer.DoJoinCommand() } } diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go index 7b0f73ce9..60753e582 100644 --- a/weed/wdclient/masterclient.go +++ b/weed/wdclient/masterclient.go @@ -52,7 +52,7 @@ func (mc *MasterClient) KeepConnectedToMaster() { } } -func (mc *MasterClient) FindLeader(myMasterAddress string) (leader string) { +func (mc *MasterClient) FindLeaderFromOtherPeers(myMasterAddress string) (leader string) { for _, master := range mc.masters { if master == myMasterAddress { continue