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

throttling/backoff for rate limits support for PyGitHub #1235

Closed
sargemonkey opened this issue Oct 2, 2019 · 4 comments
Closed

throttling/backoff for rate limits support for PyGitHub #1235

sargemonkey opened this issue Oct 2, 2019 · 4 comments
Labels

Comments

@sargemonkey
Copy link

There is no elegant way to implement throttling for github API calls through PyGitHub. The best way I can find to make sure my app doesn't hit the throttling limits is to keep checking before every call, and maintain a count of the number of calls made to the APIs, and then continuously checking if that limit is reached or not - while refreshing the rate limits periodically. It is not simple to implement a wrapper class, or apply decorators/descriptors to the calls because there various classes (like GitHub, Repository, Releases etc) that can make a call to the API endpoint. It seems implementing this feature inside PyGitHub to help throttle/ratelimit/wait calls would be the best approach IMO, since every call the the REST API can be tracked. Will such a feature be encouraged? Does it make sense to work on a pull request?

@sargemonkey
Copy link
Author

anyone?

@maxsharabayko
Copy link

See also #1233 for excessive requests.

@stale
Copy link

stale bot commented Dec 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 11, 2019
@stale stale bot closed this as completed Dec 18, 2019
@vlerenc
Copy link

vlerenc commented Mar 7, 2020

PyGithub is great, many thanks!

Is there a convenient way to instruct PyGithub not to throw a rate limit exceeded exception, but back-off and retry the operation? Otherwise, I have to do that and wrap each of my calls, which is possible, but feels wrong. That's me then performing a framework/library functionality that would better fit the actual framework/library, in this case PyGithub, then every user doing the same in their code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants