mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2025-03-29 19:59:54 +03:00
Chore: remove unused patch proxy group
This commit is contained in:
parent
9936a9469d
commit
1dcc8307ee
1 changed files with 0 additions and 21 deletions
|
@ -5,7 +5,6 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/dlclark/regexp2"
|
"github.com/dlclark/regexp2"
|
||||||
|
|
||||||
|
@ -17,18 +16,12 @@ import (
|
||||||
"github.com/Dreamacro/clash/dns"
|
"github.com/Dreamacro/clash/dns"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
defaultHealthCheckUrl = "https://www.gstatic.com/generate_204"
|
|
||||||
defaultHealthCheckInterval = time.Hour
|
|
||||||
)
|
|
||||||
|
|
||||||
var processors = []processor{
|
var processors = []processor{
|
||||||
patchOverride,
|
patchOverride,
|
||||||
patchGeneral,
|
patchGeneral,
|
||||||
patchProfile,
|
patchProfile,
|
||||||
patchDns,
|
patchDns,
|
||||||
patchProviders,
|
patchProviders,
|
||||||
patchProxyGroup,
|
|
||||||
validConfig,
|
validConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,20 +88,6 @@ func patchProviders(cfg *config.RawConfig, profileDir string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func patchProxyGroup(cfg *config.RawConfig, _ string) error {
|
|
||||||
for _, g := range cfg.ProxyGroup {
|
|
||||||
if _, exist := g["url"]; !exist {
|
|
||||||
g["url"] = defaultHealthCheckUrl
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, exist := g["interval"]; !exist {
|
|
||||||
g["interval"] = int(defaultHealthCheckInterval.Seconds())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func validConfig(cfg *config.RawConfig, _ string) error {
|
func validConfig(cfg *config.RawConfig, _ string) error {
|
||||||
if len(cfg.Proxy) == 0 && len(cfg.ProxyProvider) == 0 {
|
if len(cfg.Proxy) == 0 && len(cfg.ProxyProvider) == 0 {
|
||||||
return errors.New("profile does not contain `proxies` or `proxy-providers`")
|
return errors.New("profile does not contain `proxies` or `proxy-providers`")
|
||||||
|
|
Loading…
Add table
Reference in a new issue