Skip to content

Commit

Permalink
Retry connection errors on credentials requests
Browse files Browse the repository at this point in the history
  • Loading branch information
nvoxland committed Sep 23, 2024
1 parent 65b7383 commit d1fcd16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deeplake/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ def request(
Returns:
requests.Response: The response received from the server.
Raises:
# noqa: DAR401
requests.exceptions.ConnectionError: If any exceptions are thrown during the request
"""
params = params or {}
data = data or None
Expand All @@ -126,7 +130,7 @@ def request(

status_code = None
tries = 0
last_exception = None
last_exception: requests.exceptions.ConnectionError | None = None
while status_code is None or (status_code in retry_status_codes and tries < 3):
last_exception = None
try:
Expand Down

0 comments on commit d1fcd16

Please sign in to comment.