diff --git a/command.go b/command.go index 00af6c1d..f9d8af36 100644 --- a/command.go +++ b/command.go @@ -1906,21 +1906,21 @@ func (cmd *XInfoConsumersCmd) readReply(rd *proto.Reader) error { return err } - var idle int64 switch key { case "name": cmd.val[i].Name, err = rd.ReadString() case "pending": cmd.val[i].Pending, err = rd.ReadInt() case "idle": + var idle int64 idle, err = rd.ReadInt() + cmd.val[i].Idle = time.Duration(idle) * time.Millisecond default: return fmt.Errorf("redis: unexpected content %s in XINFO CONSUMERS reply", key) } if err != nil { return err } - cmd.val[i].Idle = time.Duration(idle) * time.Millisecond } } diff --git a/commands_test.go b/commands_test.go index 81c1bdb8..e1cceb9f 100644 --- a/commands_test.go +++ b/commands_test.go @@ -5008,6 +5008,7 @@ var _ = Describe("Commands", func() { res, err := client.XInfoConsumers(ctx, "stream", "group1").Result() Expect(err).NotTo(HaveOccurred()) for i := range res { + Expect(res[i].Idle > 0).To(BeTrue()) res[i].Idle = 0 } Expect(res).To(Equal([]redis.XInfoConsumer{