(node clusterNode)
| 419 | } |
| 420 | |
| 421 | func (c *Client) switchToNodeLocked(node clusterNode) bool { |
| 422 | host := strings.TrimSpace(node.IP) |
| 423 | if host == "" || node.Port <= 0 { |
| 424 | return false |
| 425 | } |
| 426 | if strings.TrimSpace(c.homeCfg.Host) == host && c.homeCfg.Port == node.Port { |
| 427 | return false |
| 428 | } |
| 429 | c.homeCfg.Host = host |
| 430 | c.homeCfg.Port = node.Port |
| 431 | c.closeClientsLocked() |
| 432 | return true |
| 433 | } |
| 434 | |
| 435 | func (c *Client) markReconnectFailure(reason string) { |
| 436 | switched, addr := c.failoverAfterReconnectFailure() |
no test coverage detected