-
Notifications
You must be signed in to change notification settings - Fork 181
Description
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).