MCPcopy
hub / github.com/redis/go-redis / executeDefault

Method executeDefault

osscluster_router.go:62–70  ·  view source on GitHub ↗

executeDefault handles standard command routing based on keys

(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy, node *clusterNode)

Source from the content-addressed store, hash-verified

60
61// executeDefault handles standard command routing based on keys
62func (c *ClusterClient) executeDefault(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy, node *clusterNode) error {
63 if policy != nil && !c.hasKeys(cmd) {
64 if c.readOnlyEnabled() && policy.IsReadOnly() {
65 return c.executeOnArbitraryNode(ctx, cmd)
66 }
67 }
68
69 return node.Client.Process(ctx, cmd)
70}
71
72// executeOnArbitraryNode routes command to an arbitrary node
73func (c *ClusterClient) executeOnArbitraryNode(ctx context.Context, cmd Cmder) error {

Callers 2

routeAndRunMethod · 0.95
executeSpecialCommandMethod · 0.95

Calls 5

hasKeysMethod · 0.95
readOnlyEnabledMethod · 0.95
IsReadOnlyMethod · 0.80
ProcessMethod · 0.65

Tested by

no test coverage detected