From 788a47b3933355565c8abe7dbc5911733d22f3cb Mon Sep 17 00:00:00 2001 From: Joschka Braun Date: Fri, 3 May 2024 09:35:34 -0400 Subject: [PATCH] fix: retry on RemoteProtocolError --- parea/api_client.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parea/api_client.py b/parea/api_client.py index 0e0390a5..501bd747 100644 --- a/parea/api_client.py +++ b/parea/api_client.py @@ -49,7 +49,7 @@ def _should_retry(error, current_retry): """Determines if the function should retry on error.""" is_502_error = isinstance(error, httpx.HTTPStatusError) and error.response.status_code == 502 is_last_retry = current_retry == MAX_RETRIES - 1 - return not is_last_retry and (isinstance(error, (httpx.ConnectError, httpx.ReadError)) or is_502_error) + return not is_last_retry and (isinstance(error, (httpx.ConnectError, httpx.ReadError, httpx.RemoteProtocolError)) or is_502_error) if asyncio.iscoroutinefunction(func): return async_wrapper diff --git a/pyproject.toml b/pyproject.toml index 421ce6ed..aa48d20b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "parea-ai" packages = [{ include = "parea" }] -version = "0.2.148" +version = "0.2.149" description = "Parea python sdk" readme = "README.md" authors = ["joel-parea-ai "]