Optimization: refactor picker

This commit is contained in:
Dreamacro
2019-07-02 19:18:03 +08:00
parent 0eff8516c0
commit 7c6c147a18
9 changed files with 123 additions and 104 deletions

View File

@ -1,6 +1,7 @@
package adapters
import (
"context"
"encoding/json"
"errors"
"net"
@ -90,7 +91,7 @@ func (f *Fallback) validTest() {
for _, p := range f.proxies {
go func(p C.Proxy) {
p.URLTest(f.rawURL)
p.URLTest(context.Background(), f.rawURL)
wg.Done()
}(p)
}