From 16fd55ab5882833d96047f0dfb3b36c826c8b365 Mon Sep 17 00:00:00 2001 From: Evan <2869018789@qq.com> Date: Mon, 22 Jun 2026 10:56:09 +0800 Subject: [PATCH] fix: add bounded timeout to Jina credential validation requests (#37637) --- api/services/auth/jina.py | 5 ++++- api/services/auth/jina/jina.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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), + ), )