Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
all: testdeps
go test ./...
go test ./... -short -race
go test ./... -run=NONE -bench=.
env GOOS=linux GOARCH=386 go test ./...
go vet
go get github.com/gordonklaus/ineffassign
Expand Down
9 changes: 5 additions & 4 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ func (c *ClusterClient) mapCmdsByNode(cmds []Cmder, cmdsMap *cmdsMap) error {
return err
}

cmdsAreReadOnly := c.cmdsAreReadOnly(cmds)
cmdsAreReadOnly := c.opt.ReadOnly && c.cmdsAreReadOnly(cmds)
for _, cmd := range cmds {
var node *clusterNode
var err error
Expand Down Expand Up @@ -1309,10 +1309,9 @@ func (c *ClusterClient) pipelineProcessCmds(
return err
}

err = cn.WithReader(c.opt.ReadTimeout, func(rd *proto.Reader) error {
return cn.WithReader(c.opt.ReadTimeout, func(rd *proto.Reader) error {
return c.pipelineReadCmds(node, rd, cmds, failedCmds)
})
return err
}

func (c *ClusterClient) pipelineReadCmds(
Expand All @@ -1329,7 +1328,9 @@ func (c *ClusterClient) pipelineReadCmds(
continue
}

if internal.IsRedisError(err) {
if c.opt.ReadOnly && internal.IsLoadingError(err) {
node.MarkAsLoading()
} else if internal.IsRedisError(err) {
continue
}

Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ require (
github.com/onsi/ginkgo v1.8.0
github.com/onsi/gomega v1.5.0
)

go 1.13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really need that info as nothing changed here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what go mod does automatically - not going to fight it on this matter