From bfdaed6195b051431bcdb97a563e21c39eb43680 Mon Sep 17 00:00:00 2001 From: phact Date: Thu, 21 Mar 2024 15:48:59 -0400 Subject: [PATCH] 409 is retryable --- impl/astra_vector.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/impl/astra_vector.py b/impl/astra_vector.py index 28a7795..8b73fe7 100644 --- a/impl/astra_vector.py +++ b/impl/astra_vector.py @@ -308,6 +308,12 @@ def handle_response_errors(self, response: requests.Response) -> HandledResponse detail=f"{TOKEN_AUTH_FAILURE_MESSAGE}\nCould not access url: {e.response.url}. Detail: {e.response.text}", retryable=False, ) + if e.response.status_code == 409: + return HandledResponse( + status_code=409, + detail="Conflict", + retryable=True, + ) try: response_dict = response.json() except json.JSONDecodeError: @@ -436,7 +442,6 @@ async def make_keyspace(self): # Make the POST request asynchronously async with httpx.AsyncClient() as client: response = await client.post(url, headers=headers, json=payload) - handled_response = self.handle_response_errors(response) if handled_response is not None: if handled_response.retryable: