Merge pull request #1617 from go-redis/feature/cluster-read-only

Fix ReadOnly option in ClusterClient
This commit is contained in:
Vladimir Mihailenco 2021-01-22 09:44:18 +02:00 committed by GitHub
commit b0ac2eefc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1639,7 +1639,7 @@ func (c *ClusterClient) cmdNode(
return nil, err return nil, err
} }
if (c.opt.RouteByLatency || c.opt.RouteRandomly) && cmdInfo != nil && cmdInfo.ReadOnly { if c.opt.ReadOnly && cmdInfo != nil && cmdInfo.ReadOnly {
return c.slotReadOnlyNode(state, slot) return c.slotReadOnlyNode(state, slot)
} }
return state.slotMasterNode(slot) return state.slotMasterNode(slot)