Compare commits

...

2 Commits

Author SHA1 Message Date
Aveline b73741c874 fix(timesync): queryMultipleHttp hanging if all servers are unreachable (#605) 2025-06-13 00:51:44 +02:00
Siyuan Miao 08450cb04c chore: bump version to 0.4.4 2025-06-13 00:51:44 +02:00
2 changed files with 14 additions and 3 deletions

View File

@ -2,8 +2,8 @@ BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
BUILDDATE ?= $(shell date -u +%FT%T%z)
BUILDTS ?= $(shell date -u +%s)
REVISION ?= $(shell git rev-parse HEAD)
VERSION_DEV := 0.4.4-dev$(shell date +%Y%m%d%H%M)
VERSION := 0.4.3
VERSION_DEV := 0.4.5-dev$(shell date +%Y%m%d%H%M)
VERSION := 0.4.4
PROMETHEUS_TAG := github.com/prometheus/common/version
KVM_PKG_NAME := github.com/jetkvm/kvm

View File

@ -95,16 +95,27 @@ func (t *TimeSync) queryMultipleHttp(urls []string, timeout time.Duration) (now
} else if errors.Is(err, context.Canceled) {
metricHttpCancelCount.WithLabelValues(url).Inc()
metricHttpTotalCancelCount.Inc()
results <- nil
} else {
scopedLogger.Warn().
Str("error", err.Error()).
Int("status", status).
Msg("failed to query HTTP server")
results <- nil
}
}(url)
}
return <-results
for range urls {
result := <-results
if result == nil {
continue
}
now = result
return
}
return
}
func queryHttpTime(