Skip to content

Commit

Permalink
add incremental backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
aSauerwein committed Jun 23, 2024
1 parent 1b60933 commit ffb34c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion download_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def base_req(url: str, method="get", json={}, *args, **kwargs):
break
except requests.exceptions.ChunkedEncodingError:
logger.warning(f"incomplete read occured, attempt {attempt} of 3")
sleep(1)
sleep(attempt * 3 + 1) # sleep for 1, 4, 7 seconds
else:
logger.error("giving up after 3 tries")
exit(1)
Expand Down

0 comments on commit ffb34c3

Please sign in to comment.