// doActiveHealthCheckForAllHosts immediately performs a
// health checks for all upstream hosts configured by h.
doActiveHealthCheckForAllHosts immediately performs a
health checks for all upstream hosts configured by h.
// doActiveHealthCheckForAllHosts immediately performs a // health checks for all upstream hosts configured by h .
func (h *Handler) doActiveHealthCheckForAllHosts() {
	for _, upstream := range h.Upstreams {
		go func(upstream *Upstream) {
			defer func() {
				if err := recover(); err != nil {
					log.Printf("[PANIC] active health check: %v\n%s", err, debug.Stack())
				}
			}()
			for _, p := range upstream.peers {
				err := h.doActiveHealthCheck(p)
				if err != nil {
					h.HealthChecks.Active.logger.Error("active health check failed",
						zap.String("peer", p.address.String()),
						zap.Error(err))
				}
			}
		}(upstream)
	}
}
func ( h * Handler ) doActiveHealthCheckForAllHosts ( ) { for _ , upstream := range h . Upstreams { go func ( upstream * Upstream ) { defer func ( ) { if err := recover ( ) ; err != nil { log . Printf ( " \n " , err , debug . Stack ( ) ) } } ( ) for _ , p := range upstream . peers { err := h . doActiveHealthCheck ( p ) if err != nil { h . HealthChecks . Active . logger . Error ( " " , zap . String ( " " , p . address . String ( ) ) , zap . Error ( err ) ) } } } ( upstream ) } }
doActiveHealthCheckForAllHosts immediately performs a
health checks for all upstream hosts configured by h.
doActiveHealthCheckForAllHosts immediately performs a health checks for all upstream hosts configured by h .