added ping latency to healthcheck result

This commit is contained in:
yusing
2024-11-30 06:43:47 +08:00
parent 497879fb4b
commit fb9de4c4ad
6 changed files with 50 additions and 19 deletions

View File

@@ -132,12 +132,12 @@ func (w *Watcher) getStatusUpdateReady() health.Status {
return health.StatusHealthy
}
healthy, _, err := w.hc.CheckHealth()
result, err := w.hc.CheckHealth()
switch {
case err != nil:
w.ready.Store(false)
return health.StatusError
case healthy:
case result.Healthy:
w.ready.Store(true)
return health.StatusHealthy
default: