// healthy returns true if the remote host
// is currently known to be healthy or "up".
// It consults the circuit breaker, if any.
healthy returns true if the remote host
is currently known to be healthy or "up".
It consults the circuit breaker, if any.
// healthy returns true if the remote host // is currently known to be healthy or " up " . // It consults the circuit breaker if any .
func (u *Upstream) healthy() bool {
	for _, p := range u.peers {
		if !p.healthy() {
			return false
		}
	}
	if u.healthCheckPolicy != nil && u.healthCheckPolicy.MaxFails > 0 {
		for _, p := range u.peers {
			if atomic.LoadInt32(&p.fails) >= int32(u.healthCheckPolicy.MaxFails) {
				return false
			}
		}
	}
	return true
}
func ( u * Upstream ) healthy ( ) bool { for _ , p := range u . peers { if ! p . healthy ( ) { return false } } if u . healthCheckPolicy != nil && u . healthCheckPolicy . MaxFails > 0 { for _ , p := range u . peers { if atomic . LoadInt32 ( & p . fails ) >= int32 ( u . healthCheckPolicy . MaxFails ) { return false } } } return true }
healthy returns true if the remote host
is currently known to be healthy or "up".
healthy returns true if the remote host is currently known to be healthy or " up " .