Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

fix: add ConnectError to embedding retry exceptions (#353)

S-A-D-4568085c8ad97
diff --git a/deeptutor/services/embedding/adapters/openai_compatible.py b/deeptutor/services/embedding/adapters/openai_compatible.py
index 5788a8d92..63a494af3 100644
--- a/deeptutor/services/embedding/adapters/openai_compatible.py
+++ b/deeptutor/services/embedding/adapters/openai_compatible.py
@@ -166,7 +166,7 @@ class OpenAICompatibleEmbeddingAdapter(BaseEmbeddingAdapter):
response.raise_for_status()
data = response.json()
break
- except (httpx.ReadTimeout, httpx.ConnectTimeout, httpx.PoolTimeout) as exc:
+ except (httpx.ReadTimeout, httpx.ConnectTimeout, httpx.PoolTimeout, httpx.ConnectError) as exc:
last_exc = exc
if attempt < self._MAX_RETRIES:
wait = self._RETRY_BACKOFF * (2 ** attempt)