Skip to content

Honour API Rate Limits and retry accordingly #11720

@migueleliasweb

Description

@migueleliasweb

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions