Android: patch
This commit is contained in:
@ -18,6 +18,7 @@ import (
|
||||
|
||||
const (
|
||||
defaultURLTestTimeout = time.Second * 5
|
||||
defaultURLTestURL = "https://www.gstatic.com/generate_204"
|
||||
)
|
||||
|
||||
type HealthCheckOption struct {
|
||||
@ -148,6 +149,11 @@ func (hc *HealthCheck) stop() {
|
||||
}
|
||||
|
||||
func (hc *HealthCheck) check() {
|
||||
|
||||
if len(hc.proxies) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
_, _, _ = hc.singleDo.Do(func() (struct{}, error) {
|
||||
id := utils.NewUUIDV4().String()
|
||||
log.Debugln("Start New Health Checking {%s}", id)
|
||||
@ -223,6 +229,7 @@ func NewHealthCheck(proxies []C.Proxy, url string, interval uint, lazy bool, exp
|
||||
if len(url) == 0 {
|
||||
interval = 0
|
||||
expectedStatus = nil
|
||||
url = defaultURLTestURL
|
||||
}
|
||||
|
||||
return &HealthCheck{
|
||||
|
Reference in New Issue
Block a user