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)
| 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. |
| 151 | func (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. |
| 159 | func (cc *ClusterClient) failoverLocked(ctx context.Context) error { |
nothing calls this directly
no test coverage detected