func()

in pkg/controller/liveness/liveness.go [166:190]


func (hc *HealthCheck) StartMonitoring() {
	hc.mutex.Lock()
	hc.syncMonitoringEnabled = true
	hc.monitoringRunning = true
	hc.mutex.Unlock()

	go func() {
		for {
			hc.mutex.RLock()
			if !hc.monitoringRunning {
				hc.mutex.RUnlock()
				break
			}
			hc.mutex.RUnlock()

			select {
			case <-time.After(hc.healthCheckInterval):
				alive := !hc.checkAll()
				hc.mutex.Lock()
				hc.alive = alive
				hc.mutex.Unlock()
			}
		}
	}()
}