pydactyl icon indicating copy to clipboard operation
pydactyl copied to clipboard

package does not respect rate limiting

Open mr2013 opened this issue 4 years ago • 3 comments

Specifically, the headers retry-after, x-ratelimit-limit, and x-ratelimit-remaining

mr2013 avatar May 05 '20 22:05 mr2013

You are correct, it doesn't, and that should probably be improved. In your opinion what should it do to respect these headers?

iamkubi avatar May 05 '20 22:05 iamkubi

As remaining approaches zero, implement a delay. Could be a default that can be overridden. When it reaches zero, the server sends "try-after: <x>" basically saying "You have no choice but to wait <x> seconds." In that case, you have to wait the full <x> seconds.

Suggested default delay, (4^(log(limit - remaining))) / 10

mr2013 avatar May 07 '20 18:05 mr2013

Great, thanks for your input. I'll try to get something added in the next week or so.

iamkubi avatar May 07 '20 20:05 iamkubi

Better late than never, fixed by faf7922

iamkubi avatar Sep 12 '22 06:09 iamkubi