diff options
| author | chrislu <chris.lu@gmail.com> | 2022-04-01 17:27:49 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-04-01 17:27:49 -0700 |
| commit | 4b5c0e3fa9a6e61e1cfa000567773b23fba39918 (patch) | |
| tree | f429c119a0f15a04e4260481baee479d1bad7ae8 /weed/wdclient/masterclient.go | |
| parent | 6d55716fc3196b75038e3d9486302990ae7e7832 (diff) | |
| download | seaweedfs-4b5c0e3fa9a6e61e1cfa000567773b23fba39918.tar.xz seaweedfs-4b5c0e3fa9a6e61e1cfa000567773b23fba39918.zip | |
check cluster connectivities
Diffstat (limited to 'weed/wdclient/masterclient.go')
| -rw-r--r-- | weed/wdclient/masterclient.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go index daf74c1be..53236fc6d 100644 --- a/weed/wdclient/masterclient.go +++ b/weed/wdclient/masterclient.go @@ -41,6 +41,11 @@ func (mc *MasterClient) GetMaster() pb.ServerAddress { return mc.currentMaster } +func (mc *MasterClient) GetMasters() map[string]pb.ServerAddress { + mc.WaitUntilConnected() + return mc.masters +} + func (mc *MasterClient) WaitUntilConnected() { for mc.currentMaster == "" { time.Sleep(time.Duration(rand.Int31n(200)) * time.Millisecond) |
