-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added missing idle args in XPendingExtArgs #1750
Conversation
Made changes to XPendingExt method for allowing the usage of idle argument if defined in XPendingExtArgs
Hi~ this modification is wrong, you need to check the order of the parameters, redis-server does not handle it rigorously. In addition, we need to complete it in the unit test |
For the time type, time.Duration is generally used in golang to handle it. |
What is the command for running test and also which platform is it supported by make test. If you can point me to a developer guide that will be great. As for those changes I'll do it thanks for the clarification |
You can follow github workflow, link: https://docs.github.com/en/actions/learn-github-actions/finding-and-customizing-actions |
I have updated the pull request can you verify it also I think for the first time I'll need the approval to run workflows |
According to the redis documentation, the unit of idle is milliseconds, not nanoseconds |
I have looked at the MinRetryBackoff and other fields there is no conversion which is happening for time. Duration if specified I thought the developer has to take care of that setting so should I change it so that at the time of adding it should convert it to millisec |
@monkey92t can you verify the changes now |
commands.go
Outdated
args = append(args, "xpending", a.Stream, a.Group, a.Start, a.End, a.Count) | ||
args = append(args, "xpending", a.Stream, a.Group) | ||
if a.Idle != 0 { | ||
args = append(args, "idle", a.Idle * time.Millisecond) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be: args = append(args, "idle", formatMs(ctx, a.Idle))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatMs should be a new function right where should it go I mean in which file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commands_test.go
Outdated
@@ -4229,6 +4229,7 @@ var _ = Describe("Commands", func() { | |||
infoExt, err := client.XPendingExt(ctx, &redis.XPendingExtArgs{ | |||
Stream: "stream", | |||
Group: "group", | |||
Idle: time.Duration(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can add an effective idle test, it will be good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I'll write a separate test case for Idle time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monkey92t sorry for bugging you, I have written the test case but in order to verify it I have to add a simple time.Sleep in between of the test cases and I am not sure if that is the right way to do it. I just wanted to confirm once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// sleeping for 2 millisecond to test for idle time
time.Sleep(5 * time.Millisecond)
infoExt, err = client.XPendingExt(ctx, &redis.XPendingExtArgs{
// other fields
Idle: 2 * time.Millisecond,
}).Result()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also there are some linting errors from my previous commit which is breaking the checks on mine can you tell what should I do about that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need to set a large enough time to prove the normal execution of the idle parameter.
500 milliseconds is too short, it is easy to make mistakes
args.Idle = 72 * time.Hour
infoExt, err = client.XPendingExt(ctx, args).Result()
Expect(err).NotTo(HaveOccurred())
Expect(infoExt).To(HaveLen(0))
Made changes to XPendingExt method for allowing the usage of idle argument if defined in XPendingExtArgs Fixed args order for XPending idle time Converting idle duration to milli second before passing as an argument Added separate test case for XPending with idle time Fixed comment message Added missing Idle arg in XPendingExtArgs Changed XPendingExt method to use Idle time Added test case for XPendingExt method
Signed-off-by: monkey <golang@88.com>
Signed-off-by: monkey <golang@88.com>
Fixed #1749 |
@monkey92t - Do you have a guess for when this will be released? |
I've pushed v8.8.3 |
* Added missing idle args in XPendingExtArgs (#1750) Added missing idle args in XPendingExtArgs * fix #1754 (#1756) * Replace go-pg with bun * fix #1755 Signed-off-by: monkey <golang@88.com> * fix read data Signed-off-by: monkey <golang@88.com> * fix #1758 (#1759) fix #1758 Co-authored-by: Parvez <syedparvez72@gmail.com> Co-authored-by: Vladimir Mihailenco <vladimir.webdev@gmail.com>
Made changes to XPendingExt method for allowing the usage of idle argument if defined in XPendingExtArgs