Skip to content

Commit

Permalink
fix docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Oct 18, 2023
1 parent ee16504 commit 387d082
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dsp_permissions_scripts/utils/try_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@

def http_call_with_retry(action: Callable[..., requests.Response], err_msg: str) -> requests.Response:
"""
Function that tries 7 times to execute an HTTP request.
502 and 404 are catched, and the request is retried after a waiting time.
Function that tries 9 times to execute an HTTP request.
404 and 500-599 codes are catched, together with some errors raised by the requests library,
and the request is retried after a waiting time.
The waiting times are 1, 2, 4, 8, 16, 32, 64, 128, 256 seconds.
If it still fails, the request is executed without any catch, so that the error escalates to the caller.
Use this only for actions that can be retried without side effects.
Args:
Expand Down

0 comments on commit 387d082

Please sign in to comment.