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

Method StartHealthCheck

pkg/api/cluster_client.go:207–220  ·  view source on GitHub ↗

StartHealthCheck begins periodic health checking of the active node. If the active node becomes unreachable, it automatically triggers failover. The health check pings the /api2/json/version endpoint which is lightweight.

()

Source from the content-addressed store, hash-verified

205// If the active node becomes unreachable, it automatically triggers failover.
206// The health check pings the /api2/json/version endpoint which is lightweight.
207func (cc *ClusterClient) StartHealthCheck() {
208 cc.mu.Lock()
209 defer cc.mu.Unlock()
210
211 // Stop any existing health check
212 cc.stopHealthCheckLocked()
213
214 cc.healthStop = make(chan struct{})
215 cc.healthTicker = time.NewTicker(cc.healthInterval)
216
217 go cc.healthCheckLoop()
218
219 cc.logger.Info("[CLUSTER] Health check started (interval: %s)", cc.healthInterval)
220}
221
222// StopHealthCheck stops the periodic health checking.
223func (cc *ClusterClient) StopHealthCheck() {

Callers 1

switchToClusterGroupMethod · 0.95

Calls 3

stopHealthCheckLockedMethod · 0.95
healthCheckLoopMethod · 0.95
InfoMethod · 0.65

Tested by

no test coverage detected