forked from mirror/redis
Merge pull request #1434 from GreenHedgehog/master
fix nil node dereference when use RouteByLatency in cluster
This commit is contained in:
commit
0999a925ac
|
@ -564,7 +564,11 @@ func (c *clusterState) slotClosestNode(slot int) (*clusterNode, error) {
|
||||||
node = n
|
node = n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if node != nil {
|
||||||
return node, nil
|
return node, nil
|
||||||
|
}
|
||||||
|
// If all nodes are failing - return random node
|
||||||
|
return c.nodes.Random()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *clusterState) slotRandomNode(slot int) (*clusterNode, error) {
|
func (c *clusterState) slotRandomNode(slot int) (*clusterNode, error) {
|
||||||
|
|
Loading…
Reference in New Issue