chore: healthcheck only once check at same time

This commit is contained in:
Skyxim
2022-06-25 08:53:04 +08:00
parent 109a76e1fc
commit 4ba34ce672
2 changed files with 20 additions and 13 deletions

View File

@ -111,11 +111,11 @@ func (gb *GroupBase) URLTest(ctx context.Context, url string) (map[string]uint16
wg.Add(1)
go func() {
delay, err := proxy.URLTest(ctx, url)
lock.Lock()
if err == nil {
lock.Lock()
mp[proxy.Name()] = delay
lock.Unlock()
}
lock.Unlock()
wg.Done()
}()