-
Notifications
You must be signed in to change notification settings - Fork 7k
Description
Describe the feature or problem you’d like to solve
Have gh
honour api rate limits and retry accordingly (enabled via a global flag).
This can be achieved by reading the response and replaying the request following the timestamp from the provided headers. Reference: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#checking-the-status-of-your-rate-limit.
A few related issues:
- Does the CLI honor response headers for throttling and ratelimits? #3292
- API rate limit when requesting 1000 code search results #10426
- GraphQL: API rate limit exceeded for user ID #8321
This would ideally be exposed via an optional global flag --retry-on-api-rate-limit
so there's not breaking compatibility.
I would be happy to attempt to make this change if this is deemed to be a good idea moving forward.
I couldn't find anything today that would do this directly using the CLI alone, if there is, apologies.
Proposed solution
How will it benefit CLI and its users?
Users will stop having to create their own retry logic in their scripts.
Additional context
Add any other context like screenshots or mockups are helpful, if applicable.