Skip to content

Commit

Permalink
chore: Adjust the order of adding proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
xishang0128 committed Apr 5, 2024
1 parent 58624ca commit 5bae0b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions adapter/outboundgroup/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, provide
}
groupOption.ExpectedStatus = status

var PDs []types.ProxyProvider
if len(groupOption.Use) != 0 {
PDs, err := getProviders(providersMap, groupOption.Use)
PDs, err = getProviders(providersMap, groupOption.Use)
if err != nil {
return nil, fmt.Errorf("%s: %w", groupName, err)
}
Expand All @@ -108,8 +109,6 @@ func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, provide
} else {
addTestUrlToProviders(PDs, groupOption.URL, expectedStatus, groupOption.Filter, uint(groupOption.Interval))
}

providers = append(providers, PDs...)
}

if len(groupOption.Proxies) != 0 {
Expand Down Expand Up @@ -144,6 +143,10 @@ func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, provide
providersMap[groupName] = pd
}

if len(groupOption.Use) != 0 {
providers = append(providers, PDs...)
}

var group C.ProxyAdapter
switch groupOption.Type {
case "url-test":
Expand Down

0 comments on commit 5bae0b6

Please sign in to comment.