Skip to content
Snippets Groups Projects
Verified Commit 53c30207 authored by Pea Nut's avatar Pea Nut
Browse files

Don't return gateway twice if location is selected manually, fixes #823

This fixes a small logic error. Each gateway can be multiple times in
p.recommened (for each transport). If a location was selected manually,
each gateway was added twice to the returned list. The returned list is
the list of gateways we will connect to. For more information, please
check: !213
parent e4adde88
No related branches found
No related tags found
No related merge requests found
Pipeline #228733 passed
......@@ -173,10 +173,10 @@ func (p *gatewayPool) getGatewaysFromMenshenByLocation(location, transport strin
var gateways []Gateway
for _, gw := range p.recommended {
if !gw.gateway.isTransport(transport) {
continue
}
for _, locatedGw := range gws {
if !locatedGw.isTransport(transport) {
continue
}
if locatedGw.Host == gw.gateway.Host {
gateways = append(gateways, *locatedGw)
break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment