(ctx context.Context)
| 332 | } |
| 333 | |
| 334 | func (c *Client) refreshBestClusterNode(ctx context.Context) { |
| 335 | if !c.clusterDiscoveryEnabled() { |
| 336 | return |
| 337 | } |
| 338 | switched, errRefresh := c.refreshClusterNodes(ctx) |
| 339 | if errRefresh != nil { |
| 340 | log.Debugf("home cluster nodes unavailable: %v", errRefresh) |
| 341 | return |
| 342 | } |
| 343 | if switched { |
| 344 | if addr, ok := c.addr(); ok { |
| 345 | log.Infof("home cluster target switched to %s", addr) |
| 346 | } |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | func (c *Client) refreshClusterNodes(ctx context.Context) (bool, error) { |
| 351 | if !c.clusterDiscoveryEnabled() { |
no test coverage detected