Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix bug in handle_rate_limit and take care of proper rounding. #136

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

Merged
lovvskillz merged 4 commits into lovvskillz:master from ShrirajHegde:master
Jul 20, 2023

Conversation

@ShrirajHegde
Copy link
Contributor

@ShrirajHegde ShrirajHegde commented Jul 20, 2023

https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit

According to this document, "retry_after" is the number of seconds in float.

This should prevent getting temporary bans.

Fixes #134

ShrirajHegde and others added 2 commits July 21, 2023 02:17
Copy link
Contributor Author

Btw, checks are failing due to dependency installation problem in python 3.11 check.

Copy link
Owner

Thanks for your fix 👍

ShrirajHegde reacted with thumbs up emoji

@lovvskillz lovvskillz merged commit 7dbfd4d into lovvskillz:master Jul 20, 2023
Copy link
Contributor Author

@lovvskillz Btw any plans for parsing X-RateLimit-Reset and having a global rate limit?

Because this way of handling rate limit might conflict with threads. That is, multiple threads can keep requesting without being aware of the rate limit.

Same with async. When await is called, if another task makes a request, it will create a conflict. How about storing X-RateLimit-Reset globally whenever it is available and make sure to wait until that time? Thread safety is not a problem race condition is not a serious problem if it occurs 1 or 2 times.

Copy link
Owner

@ShrirajHegde Thanks for the hint. I will be thinking about this and implementing it. Sounds good though.

ShrirajHegde reacted with thumbs up emoji

Copy link
Contributor Author

ShrirajHegde commented Jul 24, 2023
edited
Loading

@lovvskillz Hey, don't forget to publish the current fix to PyPI since the issue is serious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Hits rate limit and got me blocked temporarily

AltStyle によって変換されたページ (->オリジナル) /