From e549395e999da960d6e9a3f6cef25663b4030632 Mon Sep 17 00:00:00 2001 From: cat_shark <1716967236@qq.com> Date: Sat, 4 Jul 2026 16:16:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(lpt-ai)=EF=BC=9A=E5=A2=9E=E5=8A=A0=20LLM=20?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E5=88=B0=202=20=E5=88=86=E9=92=9F=20+=20Fast?= =?UTF-8?q?ify=20=E8=BF=9E=E6=8E=A5=E8=B6=85=E6=97=B6=203=20=E5=88=86?= =?UTF-8?q?=E9=92=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - LLM_TIMEOUT_MS 默认值 60000 → 120000 - Fastify connectionTimeout 设为 180000(3 分钟) --- src/index.ts | 1 + src/llm/client.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5dda5ca..807f844 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,6 +27,7 @@ const app = Fastify({ level: "info", redact: ["req.headers.authorization"], // 永不记录密钥 }, + connectionTimeout: 180_000, // 3 min }); await app.register(aiRoutes); diff --git a/src/llm/client.ts b/src/llm/client.ts index 94a6ab1..293ac11 100644 --- a/src/llm/client.ts +++ b/src/llm/client.ts @@ -24,7 +24,7 @@ export function loadConfig(): LlmConfig { apiUrl: process.env.LLM_API_URL ?? "https://api.siliconflow.cn/v1/chat/completions", apiKey: process.env.LLM_API_KEY ?? "", model: process.env.LLM_MODEL ?? "Qwen/Qwen2.5-32B-Instruct", - timeoutMs: Number(process.env.LLM_TIMEOUT_MS ?? 60000), + timeoutMs: Number(process.env.LLM_TIMEOUT_MS ?? 120000), }; }