RegistryCI.jl icon indicating copy to clipboard operation
RegistryCI.jl copied to clipboard

Graceful handling of rate limiting?

Open DilumAluthge opened this issue 3 years ago • 1 comments

Right now, we just error as soon as we hit a rate limit. Instead, we should probably do this

  1. 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.
  2. Compute the difference between answer to #1 and the current time
  3. Sleep for duration from #2
  4. Try the API call again

DilumAluthge avatar Jun 11 '21 01:06 DilumAluthge

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

oxinabox avatar Jun 11 '21 12:06 oxinabox