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

Method ProcessPipelineHook

tx_unwatch_test.go:107–116  ·  view source on GitHub ↗
(next redis.ProcessPipelineHook)

Source from the content-addressed store, hash-verified

105func (h *pipelineErrInjector) ProcessHook(next redis.ProcessHook) redis.ProcessHook { return next }
106
107func (h *pipelineErrInjector) ProcessPipelineHook(next redis.ProcessPipelineHook) redis.ProcessPipelineHook {
108 return func(ctx context.Context, cmds []redis.Cmder) error {
109 for _, cmd := range cmds {
110 if strings.EqualFold(cmd.Name(), "exec") {
111 return h.err // do not call next: EXEC never runs
112 }
113 }
114 return next(ctx, cmds)
115 }
116}
117
118// cmdErrInjector fails a single named command without sending it, simulating a
119// server error on that command (e.g. a WATCH that the server rejects).

Callers

nothing calls this directly

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected