RegistryCI.jl
RegistryCI.jl copied to clipboard
Graceful handling of rate limiting?
Right now, we just error as soon as we hit a rate limit. Instead, we should probably do this
- Ask GitHub when our rate limit will next reset. IIRC, we can do this with an API call that is not subject to rate limits.
- Compute the difference between
answer to #1
and the current time - Sleep for
duration from #2
- Try the API call again
Ask GitHub when our rate limit will next reset. IIRC, we can do this with an API call that is not subject to rate limits.
Yes with this API https://docs.github.com/en/rest/reference/rate-limit#get-rate-limit-status-for-the-authenticated-user
I have a feeling it is also specified in the header of the returned error status