From 185d1da2130680e048a4fa0e2cd15364a54e71dd Mon Sep 17 00:00:00 2001 From: Jack Browne Date: Tue, 28 May 2024 21:51:54 +0100 Subject: [PATCH] CP-2126 Replace value with constant --- .../src/thousandeyes_sdk/client/thousandeyes_retry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 0528d17f..eea69f16 100644 --- a/thousandeyes-sdk-client/src/thousandeyes_sdk/client/thousandeyes_retry.py +++ b/thousandeyes-sdk-client/src/thousandeyes_sdk/client/thousandeyes_retry.py @@ -40,7 +40,8 @@ class ThousandEyesRetry(Retry): def is_retry(self, method: str, status_code: int, has_retry_after: bool = False) -> bool: # Always retry on 429, regardless of method or status_forcelist - return status_code == 429 or super().is_retry(method, status_code, has_retry_after) + return (status_code == self.HTTP_TOO_MANY_REQUESTS 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)