( ctx context.Context, cmds []Cmder, moved, ask bool, addr string, failedCmds *cmdsMap, )
| 2086 | } |
| 2087 | |
| 2088 | func (c *ClusterClient) cmdsMoved( |
| 2089 | ctx context.Context, cmds []Cmder, |
| 2090 | moved, ask bool, |
| 2091 | addr string, |
| 2092 | failedCmds *cmdsMap, |
| 2093 | ) error { |
| 2094 | node, err := c.nodes.GetOrCreate(addr) |
| 2095 | if err != nil { |
| 2096 | return err |
| 2097 | } |
| 2098 | |
| 2099 | if moved { |
| 2100 | c.state.LazyReload() |
| 2101 | for _, cmd := range cmds { |
| 2102 | failedCmds.Add(node, cmd) |
| 2103 | } |
| 2104 | return nil |
| 2105 | } |
| 2106 | |
| 2107 | if ask { |
| 2108 | for _, cmd := range cmds { |
| 2109 | failedCmds.Add(node, NewCmd(ctx, "asking"), cmd) |
| 2110 | } |
| 2111 | return nil |
| 2112 | } |
| 2113 | |
| 2114 | return nil |
| 2115 | } |
| 2116 | |
| 2117 | func (c *ClusterClient) Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error { |
| 2118 | if len(keys) == 0 { |
no test coverage detected