-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add a helper function gh_rate_limit
to extract rate limit information.
#105
Conversation
… gh_response, or make a new call to "GET /rate_limit".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great! I made some small comments below.
Codecov Report
@@ Coverage Diff @@
## master #105 +/- ##
==========================================
- Coverage 50.22% 45.37% -4.86%
==========================================
Files 11 12 +1
Lines 442 454 +12
==========================================
- Hits 222 206 -16
- Misses 220 248 +28
Continue to review full report at Codecov.
|
One other wrinkle is that depending on the end point you hit you get slightly different details (since things like search have different rate limits).
All of this is available from "/rate_limit" and looks like the possible different options are: Dealing with search separately via a |
I think we can handle these separately/later, this PR is a good step already. :) |
Thanks much! |
Adds the function
gh_rate_limit
which returns basic rate limit information from either agh_response
object or a call toGET /rate_limit
.Currently returns a list with:
limit
- overall limit (integer)remaining
- remaining requests (integer)reset
- reset time for limit (datetime)Fixes #93 and may be helpful for #67.