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
|
endpoint.EdgeCheckinInterval = settings.EdgeAgentCheckinInterval
|
||||||
}
|
}
|
||||||
|
|
||||||
waitForAgentToConnect := 2 * time.Duration(endpoint.EdgeCheckinInterval)
|
time.Sleep(2 * time.Duration(endpoint.EdgeCheckinInterval) * time.Second)
|
||||||
|
|
||||||
for waitForAgentToConnect >= 0 {
|
|
||||||
waitForAgentToConnect--
|
|
||||||
time.Sleep(time.Second)
|
|
||||||
tunnel = service.GetTunnelDetails(endpoint.ID)
|
|
||||||
if tunnel.Status == portainer.EdgeAgentActive {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tunnel = service.GetTunnelDetails(endpoint.ID)
|
tunnel = service.GetTunnelDetails(endpoint.ID)
|
||||||
|
|
Loading…
Reference in New Issue