From e4b2ca97cdc79e95c2fa3ec8152aeb7c8e2611cd Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Fri, 22 Jan 2021 09:33:09 +0200 Subject: [PATCH] Fix ReadOnly option in ClusterClient --- cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster.go b/cluster.go index d8cd1d6..2ce475c 100644 --- a/cluster.go +++ b/cluster.go @@ -1639,7 +1639,7 @@ func (c *ClusterClient) cmdNode( 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 state.slotMasterNode(slot)