Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Add missing timeout to ragflow server health check (#14311)

Ricardo-M-L57f527eb02b8
diff --git a/api/utils/health_utils.py b/api/utils/health_utils.py
index 288eb79ff6..34f098b8c9 100644
--- a/api/utils/health_utils.py
+++ b/api/utils/health_utils.py
@@ -293,7 +293,7 @@ def check_ragflow_server_alive():
url = f'http://{settings.HOST_IP}:{settings.HOST_PORT}/api/v1/system/ping'
if '0.0.0.0' in url:
url = url.replace('0.0.0.0', '127.0.0.1')
- response = requests.get(url)
+ response = requests.get(url, timeout=10)
if response.status_code == 200:
return {"status": "alive", "message": f"Confirm elapsed: {(timer() - start_time) * 1000.0:.1f} ms."}
else: