Skip to content

Commit

Permalink
Define retry exceptions as tuple to retry_if_exception_type
Browse files Browse the repository at this point in the history
This is to improve readability and extensibility of exceptions
  • Loading branch information
nanonyme authored and barthalion committed Jul 30, 2024
1 parent aab9e75 commit 4b85a9f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flat-manager-client
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ class FailedJobError(Exception):
return "Job failed: %s" % (self.job)


TENACITY_RETRY_EXCEPTIONS = (retry_if_exception_type(aiohttp.client_exceptions.ServerDisconnectedError) | retry_if_exception_type(ServerApiError) | retry_if_exception_type(aiohttp.client_exceptions.ServerConnectionError) | retry_if_exception_type(aiohttp.client_exceptions.ClientOSError))
TENACITY_RETRY_EXCEPTIONS = retry_if_exception_type((
aiohttp.client_exceptions.ServerDisconnectedError,
ServerApiError,
aiohttp.client_exceptions.ServerConnectionError,
aiohttp.client_exceptions.ClientOSError,
))
TENACITY_STOP_AFTER = stop_after_delay(300)
TENACITY_WAIT_BETWEEN = wait_random_exponential(multiplier=1, max=60)

Expand Down

0 comments on commit 4b85a9f

Please sign in to comment.