// activeHealthChecker runs active health checks on a
// regular basis and blocks until
// h.HealthChecks.Active.stopChan is closed.
activeHealthChecker runs active health checks on a
regular basis and blocks until
h.HealthChecks.Active.stopChan is closed.
// activeHealthChecker runs active health checks on a // regular basis and blocks until // h . HealthChecks . Active . stopChan is closed .
func (h *Handler) activeHealthChecker() {
	defer func() {
		if err := recover(); err != nil {
			log.Printf("[PANIC] active health checks: %v\n%s", err, debug.Stack())
		}
	}()
	ticker := time.NewTicker(time.Duration(h.HealthChecks.Active.Interval))
	h.doActiveHealthCheckForAllHosts()
	for {
		select {
		case <-ticker.C:
			h.doActiveHealthCheckForAllHosts()
		case <-h.ctx.Done():
			ticker.Stop()
			return
		}
	}
}
func ( h * Handler ) activeHealthChecker ( ) { defer func ( ) { if err := recover ( ) ; err != nil { log . Printf ( " \n " , err , debug . Stack ( ) ) } } ( ) ticker := time . NewTicker ( time . Duration ( h . HealthChecks . Active . Interval ) ) h . doActiveHealthCheckForAllHosts ( ) for { select { case <- ticker . C : h . doActiveHealthCheckForAllHosts ( ) case <- h . ctx . Done ( ) : ticker . Stop ( ) return } } }
activeHealthChecker runs active health checks on a
regular basis and blocks until
h.HealthChecks.Active.stopChan is closed.
activeHealthChecker runs active health checks on a regular basis and blocks until h . HealthChecks . Active . stopChan is closed .