mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Include multi & exec in pipeline hook
This commit is contained in:
@ -317,14 +317,14 @@ var _ = Describe("Redis Ring", func() {
|
||||
ring.ForEachShard(func(shard *redis.Client) error {
|
||||
shard.AddHook(&hook{
|
||||
beforeProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) (context.Context, error) {
|
||||
Expect(cmds).To(HaveLen(1))
|
||||
Expect(cmds[0].String()).To(Equal("ping: "))
|
||||
Expect(cmds).To(HaveLen(3))
|
||||
Expect(cmds[1].String()).To(Equal("ping: "))
|
||||
stack = append(stack, "shard.BeforeProcessPipeline")
|
||||
return ctx, nil
|
||||
},
|
||||
afterProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) error {
|
||||
Expect(cmds).To(HaveLen(1))
|
||||
Expect(cmds[0].String()).To(Equal("ping: PONG"))
|
||||
Expect(cmds).To(HaveLen(3))
|
||||
Expect(cmds[1].String()).To(Equal("ping: PONG"))
|
||||
stack = append(stack, "shard.AfterProcessPipeline")
|
||||
return nil
|
||||
},
|
||||
|
Reference in New Issue
Block a user