From 9f7f07f8b95188819dc533f90210fa2c8646382c Mon Sep 17 00:00:00 2001 From: sang Date: Wed, 31 Jul 2024 10:13:35 +0800 Subject: [PATCH] Rename XPendingExt RetryCount to DeliveredTimes to avoid ambiguity --- command.go | 10 +++++----- commands_test.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/command.go b/command.go index 9ae97a95a..219e26d90 100644 --- a/command.go +++ b/command.go @@ -1741,10 +1741,10 @@ func (cmd *XPendingCmd) readReply(rd *proto.Reader) error { //------------------------------------------------------------------------------ type XPendingExt struct { - ID string - Consumer string - Idle time.Duration - RetryCount int64 + ID string + Consumer string + Idle time.Duration + DeliveredTimes int64 } type XPendingExtCmd struct { @@ -1805,7 +1805,7 @@ func (cmd *XPendingExtCmd) readReply(rd *proto.Reader) error { } cmd.val[i].Idle = time.Duration(idle) * time.Millisecond - if cmd.val[i].RetryCount, err = rd.ReadInt(); err != nil && err != Nil { + if cmd.val[i].DeliveredTimes, err = rd.ReadInt(); err != nil && err != Nil { return err } } diff --git a/commands_test.go b/commands_test.go index 9554bf9a9..f4fbfb1bf 100644 --- a/commands_test.go +++ b/commands_test.go @@ -6063,9 +6063,9 @@ var _ = Describe("Commands", func() { infoExt[i].Idle = 0 } Expect(infoExt).To(Equal([]redis.XPendingExt{ - {ID: "1-0", Consumer: "consumer", Idle: 0, RetryCount: 1}, - {ID: "2-0", Consumer: "consumer", Idle: 0, RetryCount: 1}, - {ID: "3-0", Consumer: "consumer", Idle: 0, RetryCount: 1}, + {ID: "1-0", Consumer: "consumer", Idle: 0, DeliveredTimes: 1}, + {ID: "2-0", Consumer: "consumer", Idle: 0, DeliveredTimes: 1}, + {ID: "3-0", Consumer: "consumer", Idle: 0, DeliveredTimes: 1}, })) args.Idle = 72 * time.Hour