mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
cluster: don't reload slots if address already changed.
This commit is contained in:
@ -53,13 +53,7 @@ func (c *ClusterPipeline) Exec() (cmds []Cmder, retErr error) {
|
||||
cmdsMap := make(map[string][]Cmder)
|
||||
for _, cmd := range cmds {
|
||||
slot := hashSlot(cmd.clusterKey())
|
||||
addrs := c.cluster.slotAddrs(slot)
|
||||
|
||||
var addr string
|
||||
if len(addrs) > 0 {
|
||||
addr = addrs[0] // First address is master.
|
||||
}
|
||||
|
||||
addr := c.cluster.slotMasterAddr(slot)
|
||||
cmdsMap[addr] = append(cmdsMap[addr], cmd)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user