CP-2126 Replace value with constant

This commit is contained in:
Jack Browne 2024-05-28 21:51:54 +01:00
parent cd1ef36f03
commit 185d1da213

View File

@ -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)