fix(edge) EE-2027 cannot connect to edge agent with high network latency (#6064)
Co-authored-by: Simon Meng <simon.meng@portainer.io>pull/6066/head
parent
98b8d6d0b2
commit
1157849b70
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue