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

fix(rate-limit): take in count priority #1919

Merged
merged 2 commits into from May 30, 2023
Merged

Conversation

roggervalf
Copy link
Collaborator

fixes #1915

@roggervalf roggervalf requested a review from manast May 26, 2023 06:02
@@ -31,11 +34,19 @@ if lockToken == token and pttl > 0 then
local target = getTargetQueueList(KEYS[6], KEYS[2], KEYS[5])

rcall("SREM", KEYS[3], jobId)
rcall("RPUSH", target, jobId)

local priority = tonumber(rcall("HGET", ARGV[3] .. jobId, "priority")) or 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if we can, we should pass the job key as a key instead of building it dynamically. In this case, we know the key of the job before calling the script, so we could just send that key instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me

@roggervalf roggervalf merged commit b8157a3 into master May 30, 2023
10 checks passed
@roggervalf roggervalf deleted the rate-limit-priority branch May 30, 2023 23:38
github-actions bot pushed a commit that referenced this pull request May 30, 2023
## [3.14.2](v3.14.1...v3.14.2) (2023-05-30)

### Bug Fixes

* **python:** fix 'install_requires' to include semver ([#1927](#1927)) ([ce86ece](ce86ece))
* **rate-limit:** take in count priority ([#1919](#1919)) fixes [#1915](#1915) ([b8157a3](b8157a3))
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

Successfully merging this pull request may close these issues.

[Bug]: Wrong job is picked after rate limit with priority
2 participants