From 5bae0b673086be8f97cb632ac0f5c5f41efcf92f Mon Sep 17 00:00:00 2001 From: xishang0128 Date: Sat, 6 Apr 2024 02:49:57 +0800 Subject: [PATCH] chore: Adjust the order of adding proxies --- adapter/outboundgroup/parser.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/adapter/outboundgroup/parser.go b/adapter/outboundgroup/parser.go index ac4546d822..6ad4ff027b 100644 --- a/adapter/outboundgroup/parser.go +++ b/adapter/outboundgroup/parser.go @@ -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) } @@ -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 { @@ -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":