swh-lister/swh
Antoine Lambert d1fbccd988 lister: Add utility decorator to ease HTTP requests rate limit handling
Add swh.lister.utils.throttling_retry decorator enabling to retry a
function that performs an HTTP request who can return a 429 status code.

The implementation is based on the tenacity module and it is assumed
that the requests library is used when querying an URL.

The default wait strategy is based on exponential backoff.

The default max number of attempts is set to 5, HTTPError exception
will then be reraised.

All tenacity.retry parameters can also be overridden in client code.
2021-01-18 11:28:51 +01:00
..
lister lister: Add utility decorator to ease HTTP requests rate limit handling 2021-01-18 11:28:51 +01:00
__init__.py typing: minimal changes to make a no-op mypy run pass 2019-10-28 15:35:21 +01:00