Skip to content

Commit

Permalink
409 is retryable
Browse files Browse the repository at this point in the history
  • Loading branch information
phact committed Mar 21, 2024
1 parent 099a555 commit bfdaed6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion impl/astra_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit bfdaed6

Please sign in to comment.