Skip to content
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

Documentation regarding priority is incorrect #37

Open
stuartcarnie opened this issue Nov 6, 2013 · 0 comments
Open

Documentation regarding priority is incorrect #37

stuartcarnie opened this issue Nov 6, 2013 · 0 comments

Comments

@stuartcarnie
Copy link

The documentation indicates a lower value indicates more priority, which is incorrect according to implementation.

Items are added to a sorted set using the following formula, where priority defaults to 0:

score = priority - (now / 10000000000)

Using current unix time stamps means typically items are scored with negative numbers like -0.1383766174 and getting smaller. Items are popped off using ZREVRANGE, which sorts from largest to smallest. If we set a negative priority, the item will not be fetched until the queue is empty, given that even a priority of -1 will make it considerably smaller than the default values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant