mirror of https://github.com/go-redis/redis.git
cluster: retry same node on retryable error
This commit is contained in:
parent
467749ade8
commit
092971361b
|
@ -816,6 +816,12 @@ func (c *ClusterClient) defaultProcess(cmd Cmder) error {
|
|||
}
|
||||
|
||||
if internal.IsRetryableError(err, true) {
|
||||
// Firstly retry the same node.
|
||||
if attempt == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
// Secondly try random node.
|
||||
node, err = c.nodes.Random()
|
||||
if err != nil {
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue