parent
a7aa5fd523
commit
972d3f1d39
@ -56,6 +56,12 @@ func NewGroupBase(opt GroupBaseOption) *GroupBase {
|
|||||||
return gb
|
return gb
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (gb *GroupBase) Touch() {
|
||||||
|
for _, pd := range gb.providers {
|
||||||
|
pd.Touch()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (gb *GroupBase) GetProxies(touch bool) []C.Proxy {
|
func (gb *GroupBase) GetProxies(touch bool) []C.Proxy {
|
||||||
if len(gb.filterRegs) == 0 {
|
if len(gb.filterRegs) == 0 {
|
||||||
var proxies []C.Proxy
|
var proxies []C.Proxy
|
||||||
|
@ -61,6 +61,9 @@ func (u *URLTest) Unwrap(metadata *C.Metadata, touch bool) C.Proxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *URLTest) fast(touch bool) C.Proxy {
|
func (u *URLTest) fast(touch bool) C.Proxy {
|
||||||
|
if touch {
|
||||||
|
u.Touch()
|
||||||
|
}
|
||||||
elm, _, _ := u.fastSingle.Do(func() (C.Proxy, error) {
|
elm, _, _ := u.fastSingle.Do(func() (C.Proxy, error) {
|
||||||
proxies := u.GetProxies(touch)
|
proxies := u.GetProxies(touch)
|
||||||
fast := proxies[0]
|
fast := proxies[0]
|
||||||
|
@ -112,6 +112,7 @@ type ProxyAdapter interface {
|
|||||||
type Group interface {
|
type Group interface {
|
||||||
URLTest(ctx context.Context, url string) (mp map[string]uint16, err error)
|
URLTest(ctx context.Context, url string) (mp map[string]uint16, err error)
|
||||||
GetProxies(touch bool) []Proxy
|
GetProxies(touch bool) []Proxy
|
||||||
|
Touch()
|
||||||
}
|
}
|
||||||
|
|
||||||
type DelayHistory struct {
|
type DelayHistory struct {
|
||||||
|
Reference in New Issue
Block a user