From 1157849b7071e31783b38841fd718cbd2a853049 Mon Sep 17 00:00:00 2001 From: cong meng Date: Fri, 12 Nov 2021 13:12:09 +1300 Subject: [PATCH] fix(edge) EE-2027 cannot connect to edge agent with high network latency (#6064) Co-authored-by: Simon Meng --- api/chisel/tunnel.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/api/chisel/tunnel.go b/api/chisel/tunnel.go index a811fcd92..884c08baa 100644 --- a/api/chisel/tunnel.go +++ b/api/chisel/tunnel.go @@ -80,16 +80,7 @@ func (service *Service) GetActiveTunnel(endpoint *portainer.Endpoint) (*portaine endpoint.EdgeCheckinInterval = settings.EdgeAgentCheckinInterval } - waitForAgentToConnect := 2 * time.Duration(endpoint.EdgeCheckinInterval) - - for waitForAgentToConnect >= 0 { - waitForAgentToConnect-- - time.Sleep(time.Second) - tunnel = service.GetTunnelDetails(endpoint.ID) - if tunnel.Status == portainer.EdgeAgentActive { - break - } - } + time.Sleep(2 * time.Duration(endpoint.EdgeCheckinInterval) * time.Second) } tunnel = service.GetTunnelDetails(endpoint.ID)