Skip to content

lack of flexibilty in retries #1234

@ericphanson

Description

@ericphanson

Sometimes the server tells you how long to wait before you can retry with a response header, e.g. with GitHub's API: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#exceeding-the-rate-limit

However, the HTTP client code lets us pass delays (which is an iterable that doesn't have access to the responses) and retry_check, which only allows us to trigger a retry based on a response if one wasn't going to happen otherwise. I don't see any way to configure the retries so that the amount of time we wait before the retry depends on a header from the response.

In the meantime, the way to go for this situation is probably to do the retries manually, outside of HTTP.request (and use retries=false to prevent HTTP from doing its own retries).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions