executeOnAllNodes executes command on all nodes (masters and replicas)
(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy)
| 80 | |
| 81 | // executeOnAllNodes executes command on all nodes (masters and replicas) |
| 82 | func (c *ClusterClient) executeOnAllNodes(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy) error { |
| 83 | state, err := c.state.Get(ctx) |
| 84 | if err != nil { |
| 85 | return err |
| 86 | } |
| 87 | |
| 88 | nodes := append(state.Masters, state.Slaves...) |
| 89 | if len(nodes) == 0 { |
| 90 | return errClusterNoNodes |
| 91 | } |
| 92 | |
| 93 | return c.executeParallel(ctx, cmd, nodes, policy) |
| 94 | } |
| 95 | |
| 96 | // executeOnAllShards executes command on all master shards |
| 97 | func (c *ClusterClient) executeOnAllShards(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy) error { |
no test coverage detected