uplink icon indicating copy to clipboard operation
uplink copied to clipboard

@retry should respect 429 `Retry-After` headers

Open prkumar opened this issue 3 years ago • 2 comments

Discussed in https://github.com/prkumar/uplink/discussions/235

Originally posted by mivade December 20, 2021 RFC 6585 describes the 429 status code to indicate hitting rate limits. This type of response may include a Retry-After header indicating the time in seconds to wait before trying again. Naively I would expect to be able to define my own backoff function to parse this header and yield that value to indicate how long to wait, but it looks like backoff functions have no knowledge of the response itself. Is there a way to get this functionality?

prkumar avatar Dec 29 '21 19:12 prkumar

Some additional context: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After

prkumar avatar Jan 05 '22 03:01 prkumar

The new RetryBackoff class is available now in v0.9.6!

prkumar avatar Jan 24 '22 21:01 prkumar