-
Notifications
You must be signed in to change notification settings - Fork 410
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
fix(delayed): avoid using jobId in order to schedule delayed jobs #2587
Conversation
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.
I propose a different way to calculate the score for the delayed job in the ZSET by using ZCOUNT https://redis.io/docs/latest/commands/zcount/ using as range all the possible values that a delayed job could get within a timestamp, that is:
[timestamp * 4096, (timestamp + 1) * 4096]. The count + 1 would then be used as the jobCounter is used today.
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.
This looks good to me. Lets give it a bit more thought before merging just to make sure it really works well.
229d5fc
to
84a1e89
Compare
84a1e89
to
5401174
Compare
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.
I think this is a great PR, for me everything looks correct.
## [5.8.6](v5.8.5...v5.8.6) (2024-07-11) ### Bug Fixes * **delayed:** avoid using jobId in order to schedule delayed jobs ([#2587](#2587)) (python) ([228db2c](228db2c))
ref OptimalBits/bull#2742