Adding retries to Requests.get() with exponential backoff
Project description
get_retries
Adding retries to Requests.get()
with exponential backoff.
Retry unsuccessful GET
requests after waiting for a specific time interval. With each unsuccessful request, the time interval increases exponentially (it doubles). The undertaking is declared ultimately unsuccessful when the time interval gets bigger than a maximum backoff value.
Install
pip install get_requests
Usage
import get_requests
# max_backoff: maximum interval to wait in seconds
response = get_requests.get('https://wikipedia.com', max_backoff=32)
if response:
print(response.status_code)
For more information check out the code.
License
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
get_retries-0.1.0.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for get_retries-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 109eb96f57ab0866119db47c369ffc4d7c4056881cf24361fb450b21772e7cd0 |
|
MD5 | 8d713277251dad78392971f1dd1f486e |
|
BLAKE2b-256 | d30c8b88200bfe2d95e4d27f459d73dbd2246f4b1631697378b6539112acc527 |