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

Fixed incorrect TTL and Retry-After values for Redis #490

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emilbm
Copy link

@emilbm emilbm commented Oct 2, 2024

This PR fixes an issue with the Redis rate limiter that results in incorrect Retry-After headers, effectively meaning that the API will tell you to call in X seconds, even though there's Y seconds remaining. The 'actual' times are correct, but the Retry-After headers were basically unusable.

It is fixed by using the remaining TTL from Redis and the known interval to calculate how long ago the first call was made, and then adding the interval to that.

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.

1 participant