From 100929e23a5df55c4e3a46ebb900fd89096f552d Mon Sep 17 00:00:00 2001 From: Wangjunqi123 Date: Wed, 22 Nov 2023 10:27:29 +0800 Subject: [PATCH] modfiy initmachinelist() --- server/agentmanager/topoclient.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/server/agentmanager/topoclient.go b/server/agentmanager/topoclient.go index 030e6a1..0c7cfca 100644 --- a/server/agentmanager/topoclient.go +++ b/server/agentmanager/topoclient.go @@ -34,16 +34,24 @@ type Topoclient struct { } func (t *Topoclient) InitMachineList() { + i := 0 + loop := []string{`*.....`, `.*....`, `..*...`, `...*..`, `....*.`, `.....*`} for { if Topo.Sdkmethod.Server() != "" { break } - - logger.Debug("waiting for handshake with pilotgo server...") - time.Sleep(2 * time.Second) + fmt.Printf("\r Waiting for handshake with pilotgo server%s", loop[i]) + if i < 5 { + i++ + } else { + i = 0 + } + time.Sleep(1 * time.Second) } - url := "http://" + Topo.Sdkmethod.Server() + "/api/v1/pluginapi/machine_list" + // ttcode + url := "http://" + conf.Config().PilotGo.Addr + "/api/v1/pluginapi/machine_list" + // url := "http://" + Topo.Sdkmethod.Server() + "/api/v1/pluginapi/machine_list" resp, err := httputils.Get(url, nil) if err != nil { @@ -92,7 +100,9 @@ func (t *Topoclient) InitMachineList() { } func (t *Topoclient) UpdateMachineList() { - url := "http://" + Topo.Sdkmethod.Server() + "/api/v1/pluginapi/machine_list" + // ttcode + url := "http://" + conf.Config().PilotGo.Addr + "/api/v1/pluginapi/machine_list" + // url := "http://" + Topo.Sdkmethod.Server() + "/api/v1/pluginapi/machine_list" resp, err := httputils.Get(url, nil) if err != nil { -- Gitee