-
Notifications
You must be signed in to change notification settings - Fork 63
Respect GitHub rate-limit headers in responses #233
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
base: master
Are you sure you want to change the base?
Conversation
I think I should add a limit that if we want to sleep more than say 15 mins, we error instead with a clear error message. Since in many cases it would be unexpected that your task will just sleep for 12 hours or something like that. Super long waits can happen when you use up your quota and it wants to wait for a refresh. This value could be configurable with some “reasonable” default. edit: done in 416b21e |
@ericphanson Can you also try this functionality out from a non-fork PR, so we can see if there's any behavior difference between a user's PAT and the GitHub Actions |
It looks like CI is failing because we are rate-limited when calling
Lines 65 to 69 in 942e814
Which in turn should call GitHub.jl/src/utils/requests.jl Line 78 in 942e814
@ericphanson Would it be possible to add your rate-limiting logic to |
src/utils/requests.jl
Outdated
delay_seconds = safe_tryparse(Float64, retry_after) | ||
if delay_seconds !== nothing | ||
delay_seconds = parse(Float64, retry_after) | ||
verbose && @info "$msg, retrying in $(round(delay_seconds, digits=1))s" method=method status=status limit=limit remaining=remaining used=used reset=reset_time resource=resource retry_after=retry_after |
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.
Could you Dates.canonicalize()
the delay_seconds
, to make it easier to read?
It is there! Every API request in this package should be covered. That's the |
Co-authored-by: Dilum Aluthge <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #233 +/- ##
==========================================
+ Coverage 55.19% 58.85% +3.66%
==========================================
Files 37 37
Lines 904 982 +78
==========================================
+ Hits 499 578 +79
+ Misses 405 404 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
closes #231
written with claude code, though with a lot of hand-holding.
Example of hitting the rate limit in real life: