Skip to content

Commit

Permalink
fix(group.parser): set default TestURL if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
riolurs committed Apr 4, 2024
1 parent d1539e6 commit 90bf158
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions adapter/outboundgroup/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, provide
return nil, fmt.Errorf("%s: %w", groupName, errDuplicateProvider)
}

// select don't need health check
if groupOption.Type != "select" && groupOption.Type != "relay" {
if groupOption.Interval == 0 {
groupOption.Interval = 300
}
if groupOption.URL == "" {
groupOption.URL = C.DefaultTestURL
}
if groupOption.Interval == 0 {
groupOption.Interval = 300
}

if groupOption.URL == "" {
groupOption.URL = C.DefaultTestURL
}

hc := provider.NewHealthCheck(ps, groupOption.URL, uint(groupOption.TestTimeout), uint(groupOption.Interval), groupOption.Lazy, expectedStatus)
Expand Down

1 comment on commit 90bf158

@cchhlearn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete if groupOption.Type != "select" && groupOption.Type != "relay"?

Please sign in to comment.