mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 16:41:30 +00:00
Fix urltest log
This commit is contained in:
parent
187de6c738
commit
4abf669d09
|
@ -183,6 +183,7 @@ func (g *URLTestGroup) checkOutbounds() {
|
||||||
b, _ := batch.New(context.Background(), batch.WithConcurrencyNum[any](10))
|
b, _ := batch.New(context.Background(), batch.WithConcurrencyNum[any](10))
|
||||||
checked := make(map[string]bool)
|
checked := make(map[string]bool)
|
||||||
for _, detour := range g.outbounds {
|
for _, detour := range g.outbounds {
|
||||||
|
tag := detour.Tag()
|
||||||
realTag := RealTag(detour)
|
realTag := RealTag(detour)
|
||||||
if checked[realTag] {
|
if checked[realTag] {
|
||||||
continue
|
continue
|
||||||
|
@ -201,10 +202,10 @@ func (g *URLTestGroup) checkOutbounds() {
|
||||||
defer cancel()
|
defer cancel()
|
||||||
t, err := urltest.URLTest(ctx, g.link, p)
|
t, err := urltest.URLTest(ctx, g.link, p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
g.logger.Debug("outbound ", detour.Tag(), " unavailable: ", err)
|
g.logger.Debug("outbound ", tag, " unavailable: ", err)
|
||||||
g.router.URLTestHistoryStorage(true).DeleteURLTestHistory(realTag)
|
g.router.URLTestHistoryStorage(true).DeleteURLTestHistory(realTag)
|
||||||
} else {
|
} else {
|
||||||
g.logger.Debug("outbound ", detour.Tag(), " available: ", t, "ms")
|
g.logger.Debug("outbound ", tag, " available: ", t, "ms")
|
||||||
g.router.URLTestHistoryStorage(true).StoreURLTestHistory(realTag, &urltest.History{
|
g.router.URLTestHistoryStorage(true).StoreURLTestHistory(realTag, &urltest.History{
|
||||||
Time: time.Now(),
|
Time: time.Now(),
|
||||||
Delay: t,
|
Delay: t,
|
||||||
|
|
Loading…
Reference in a new issue