Skip to content

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