Skip to content

Commit

Permalink
Added retry for timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
itrujnara committed May 28, 2024
1 parent df4b8a6 commit 3b82f75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def safe_get(url: str):
return requests.get(url, timeout = 300)
except requests.exceptions.Timeout as e:
print(f"Request timed out. This might be due to a server issue. If this persists, try again later. Details:\n{e}", file=sys.stderr)
sys.exit(9)
sys.exit(10)
except requests.exceptions.RequestException as e:
print(f"A network issue occurred. Retrying request. Details:\n{e}", file=sys.stderr)
sys.exit(10)
Expand All @@ -32,7 +32,7 @@ def safe_post(url: str, data: dict = dict(), json: dict = dict()):
return requests.post(url, data = data, json = json, timeout = 300)
except requests.exceptions.Timeout as e:
print(f"Request timed out. This might be due to a server issue. If this persists, try again later. Details:\n{e}", file=sys.stderr)
sys.exit(9)
sys.exit(10)
except requests.exceptions.RequestException as e:
print(f"A network issue occurred. Retrying request. Details:\n{e}", file=sys.stderr)
sys.exit(10)
Expand Down

0 comments on commit 3b82f75

Please sign in to comment.