Skip to content
Snippets Groups Projects
Commit 1dcc8307 authored by kr328's avatar kr328
Browse files

Chore: remove unused patch proxy group

parent 9936a946
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"strings"
"time"
"github.com/dlclark/regexp2"
......@@ -17,18 +16,12 @@ import (
"github.com/Dreamacro/clash/dns"
)
const (
defaultHealthCheckUrl = "https://www.gstatic.com/generate_204"
defaultHealthCheckInterval = time.Hour
)
var processors = []processor{
patchOverride,
patchGeneral,
patchProfile,
patchDns,
patchProviders,
patchProxyGroup,
validConfig,
}
......@@ -95,20 +88,6 @@ func patchProviders(cfg *config.RawConfig, profileDir string) error {
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 {
if len(cfg.Proxy) == 0 && len(cfg.ProxyProvider) == 0 {
return errors.New("profile does not contain `proxies` or `proxy-providers`")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment