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

Method Failover

pkg/api/cluster_client.go:151–156  ·  view source on GitHub ↗

Failover attempts to connect to the next available candidate. It tries candidates in round-robin order starting from the one after the currently active profile. Returns an error if no candidate is reachable.

(ctx context.Context)

Source from the content-addressed store, hash-verified

149// It tries candidates in round-robin order starting from the one after
150// the currently active profile. Returns an error if no candidate is reachable.
151func (cc *ClusterClient) Failover(ctx context.Context) error {
152 cc.mu.Lock()
153 defer cc.mu.Unlock()
154
155 return cc.failoverLocked(ctx)
156}
157
158// failoverLocked performs the failover while holding the write lock.
159func (cc *ClusterClient) failoverLocked(ctx context.Context) error {

Callers

nothing calls this directly

Calls 1

failoverLockedMethod · 0.95

Tested by

no test coverage detected