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

Why Retry-After and Reset is the same? #48

Open
molfar opened this issue Apr 6, 2020 · 1 comment
Open

Why Retry-After and Reset is the same? #48

molfar opened this issue Apr 6, 2020 · 1 comment

Comments

@molfar
Copy link

molfar commented Apr 6, 2020

Should X-RateLimit-Reset response be number of seconds until maximum capacity of limit? If so, in my example it is always the same as Retry-After.

irb(main):004:0> 60.times { p redis.call('CL.THROTTLE', 'testkey', 0, 3, 60, 1); sleep 1 }
[0, 1, 0, -1, 20]
[1, 1, 0, 18, 18]
[1, 1, 0, 17, 17]
[1, 1, 0, 16, 16]
[1, 1, 0, 15, 15]
[1, 1, 0, 14, 14]
[1, 1, 0, 13, 13]
[1, 1, 0, 12, 12]
[1, 1, 0, 11, 11]
[1, 1, 0, 10, 10]
[1, 1, 0, 9, 9]
[1, 1, 0, 8, 8]
[1, 1, 0, 7, 7]
[1, 1, 0, 6, 6]
[1, 1, 0, 5, 5]
[1, 1, 0, 4, 4]
[1, 1, 0, 3, 3]
[1, 1, 0, 2, 2]
[1, 1, 0, 1, 1]
[1, 1, 0, 0, 0]
[0, 1, 0, -1, 20]
[1, 1, 0, 18, 18]
[1, 1, 0, 17, 17]
[1, 1, 0, 16, 16]
[1, 1, 0, 15, 15]
[1, 1, 0, 14, 14]
[1, 1, 0, 13, 13]
[1, 1, 0, 12, 12]
[1, 1, 0, 11, 11]
[1, 1, 0, 10, 10]
[1, 1, 0, 9, 9]
[1, 1, 0, 8, 8]
[1, 1, 0, 7, 7]
[1, 1, 0, 6, 6]
[1, 1, 0, 5, 5]
[1, 1, 0, 4, 4]
[1, 1, 0, 3, 3]
[1, 1, 0, 2, 2]
[1, 1, 0, 1, 1]
[1, 1, 0, 0, 0]
[0, 1, 0, -1, 20]
[1, 1, 0, 18, 18]
[1, 1, 0, 17, 17]
[1, 1, 0, 16, 16]
[1, 1, 0, 15, 15]
[1, 1, 0, 14, 14]
[1, 1, 0, 13, 13]
[1, 1, 0, 12, 12]
[1, 1, 0, 11, 11]
[1, 1, 0, 10, 10]
[1, 1, 0, 9, 9]
[1, 1, 0, 8, 8]
[1, 1, 0, 7, 7]
[1, 1, 0, 6, 6]
[1, 1, 0, 5, 5]
[1, 1, 0, 4, 4]
[1, 1, 0, 3, 3]
[1, 1, 0, 2, 2]
[1, 1, 0, 1, 1]
[1, 1, 0, 0, 0]
@fxn
Copy link
Contributor

fxn commented Apr 8, 2022

Maybe related, I am seeing headers like:

'X-Ratelimit-Reset': '46', 'Retry-After': '10'
'X-Ratelimit-Reset': '36', 'Retry-After': '0'

and in none of those cases Retry-After has a value that allows me to avoid a 429, I need to wait X-Ratelimit-Reset.

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

2 participants