Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: add bounded timeout to Jina credential validation requests (#37637)

Evan16fd55ab5882
diff --git a/api/services/auth/jina.py b/api/services/auth/jina.py
index c5e9ac2d1c5..125596e1a60 100644
--- a/api/services/auth/jina.py
+++ b/api/services/auth/jina.py
@@ -8,7 +8,10 @@ from services.auth.api_key_auth_base import ApiKeyAuthBase, AuthCredentials
_http_client: httpx.Client = get_pooled_http_client(
"auth:jina_standalone",
- lambda: httpx.Client(limits=httpx.Limits(max_keepalive_connections=50, max_connections=100)),
+ lambda: httpx.Client(
+ timeout=httpx.Timeout(10.0),
+ limits=httpx.Limits(max_keepalive_connections=50, max_connections=100),
+ ),
)
diff --git a/api/services/auth/jina/jina.py b/api/services/auth/jina/jina.py
index 6260b6b48ad..da0696b94fa 100644
--- a/api/services/auth/jina/jina.py
+++ b/api/services/auth/jina/jina.py
@@ -8,7 +8,10 @@ from services.auth.api_key_auth_base import ApiKeyAuthBase, AuthCredentials
_http_client: httpx.Client = get_pooled_http_client(
"auth:jina",
- lambda: httpx.Client(limits=httpx.Limits(max_keepalive_connections=50, max_connections=100)),
+ lambda: httpx.Client(
+ timeout=httpx.Timeout(10.0),
+ limits=httpx.Limits(max_keepalive_connections=50, max_connections=100),
+ ),
)