mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
parent
a7aa5fd523
commit
972d3f1d39
|
@ -56,6 +56,12 @@ func NewGroupBase(opt GroupBaseOption) *GroupBase {
|
|||
return gb
|
||||
}
|
||||
|
||||
func (gb *GroupBase) Touch() {
|
||||
for _, pd := range gb.providers {
|
||||
pd.Touch()
|
||||
}
|
||||
}
|
||||
|
||||
func (gb *GroupBase) GetProxies(touch bool) []C.Proxy {
|
||||
if len(gb.filterRegs) == 0 {
|
||||
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 {
|
||||
if touch {
|
||||
u.Touch()
|
||||
}
|
||||
elm, _, _ := u.fastSingle.Do(func() (C.Proxy, error) {
|
||||
proxies := u.GetProxies(touch)
|
||||
fast := proxies[0]
|
||||
|
|
|
@ -112,6 +112,7 @@ type ProxyAdapter interface {
|
|||
type Group interface {
|
||||
URLTest(ctx context.Context, url string) (mp map[string]uint16, err error)
|
||||
GetProxies(touch bool) []Proxy
|
||||
Touch()
|
||||
}
|
||||
|
||||
type DelayHistory struct {
|
||||
|
|
Loading…
Reference in New Issue
Block a user