fix: increase Ollama health check timeout to prevent false offline status
All checks were successful
CD Pipeline / deploy (push) Successful in 1m18s

This commit is contained in:
OoO
2026-04-28 12:35:58 +08:00
parent 7bb97ed252
commit 1ecec162dd

View File

@@ -56,8 +56,8 @@ class OllamaService:
return OllamaService._connection_cache['status']
try:
# V-Opt: 縮短超時時間從 10 秒改為 3 秒
response = requests.get(f"{self.host}/api/tags", timeout=3)
# V-Opt: 增加超時時間避免 Ollama 負載高時誤判為離線
response = requests.get(f"{self.host}/api/tags", timeout=10)
if response.status_code == 200:
data = response.json()
self.available_models = [m['name'] for m in data.get('models', [])]