mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Close connections to unused nodes
This commit is contained in:
@ -28,8 +28,9 @@ func (c *ClusterClient) SlotAddrs(slot int) []string {
|
||||
}
|
||||
|
||||
// SwapSlot swaps a slot's master/slave address for testing MOVED redirects.
|
||||
func (c *ClusterClient) SwapSlotNodes(slot int) []string {
|
||||
func (c *ClusterClient) SwapSlotNodes(slot int) {
|
||||
nodes := c.state().slots[slot]
|
||||
nodes[0], nodes[1] = nodes[1], nodes[0]
|
||||
return c.SlotAddrs(slot)
|
||||
if len(nodes) == 2 {
|
||||
nodes[0], nodes[1] = nodes[1], nodes[0]
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user