1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

cluster: optimize newClusterState

This commit is contained in:
Vladimir Mihailenco
2018-07-22 10:50:26 +03:00
parent 493945402e
commit 2559f32464
6 changed files with 109 additions and 61 deletions

View File

@ -49,7 +49,7 @@ func (c *ClusterClient) Nodes(key string) ([]*clusterNode, error) {
}
slot := hashtag.Slot(key)
nodes := state.slots[slot]
nodes := state.slotNodes(slot)
if len(nodes) != 2 {
return nil, fmt.Errorf("slot=%d does not have enough nodes: %v", slot, nodes)
}