MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / healthCheckLoop

Method healthCheckLoop

pkg/api/cluster_client.go:242–260  ·  view source on GitHub ↗

healthCheckLoop runs the periodic health check in a goroutine.

()

Source from the content-addressed store, hash-verified

240
241// healthCheckLoop runs the periodic health check in a goroutine.
242func (cc *ClusterClient) healthCheckLoop() {
243 cc.mu.RLock()
244 ticker := cc.healthTicker
245 stop := cc.healthStop
246 cc.mu.RUnlock()
247
248 if ticker == nil || stop == nil {
249 return
250 }
251
252 for {
253 select {
254 case <-stop:
255 return
256 case <-ticker.C:
257 cc.performHealthCheck()
258 }
259 }
260}
261
262// performHealthCheck pings the active node and triggers failover if unreachable.
263func (cc *ClusterClient) performHealthCheck() {

Callers 1

StartHealthCheckMethod · 0.95

Calls 1

performHealthCheckMethod · 0.95

Tested by

no test coverage detected