From cd1ef36f03ace764603f4c1bcc37243a3fd28c1f Mon Sep 17 00:00:00 2001 From: Jack Browne Date: Tue, 28 May 2024 11:02:20 +0100 Subject: [PATCH] CP-2126 Small optimisation in retry handling --- .../src/thousandeyes_sdk/client/thousandeyes_retry.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/thousandeyes-sdk-client/src/thousandeyes_sdk/client/thousandeyes_retry.py b/thousandeyes-sdk-client/src/thousandeyes_sdk/client/thousandeyes_retry.py index b27a5a14..0528d17f 100644 --- a/thousandeyes-sdk-client/src/thousandeyes_sdk/client/thousandeyes_retry.py +++ b/thousandeyes-sdk-client/src/thousandeyes_sdk/client/thousandeyes_retry.py @@ -39,9 +39,8 @@ class ThousandEyesRetry(Retry): remove_headers_on_redirect, backoff_jitter) def is_retry(self, method: str, status_code: int, has_retry_after: bool = False) -> bool: - ret = super().is_retry(method, status_code, has_retry_after) # Always retry on 429, regardless of method or status_forcelist - return ret or status_code == 429 + return status_code == 429 or super().is_retry(method, status_code, has_retry_after) def get_retry_after(self, response: BaseHTTPResponse) -> Optional[float]: retry_after: Optional[float] = super().get_retry_after(response)