fix(lpt-ai):增加 LLM 超时到 2 分钟 + Fastify 连接超时 3 分钟

- LLM_TIMEOUT_MS 默认值 60000 → 120000
- Fastify connectionTimeout 设为 180000(3 分钟)
This commit is contained in:
2026-07-04 16:16:20 +08:00
parent a5a1b848d0
commit e549395e99
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -27,6 +27,7 @@ const app = Fastify({
level: "info", level: "info",
redact: ["req.headers.authorization"], // 永不记录密钥 redact: ["req.headers.authorization"], // 永不记录密钥
}, },
connectionTimeout: 180_000, // 3 min
}); });
await app.register(aiRoutes); await app.register(aiRoutes);
+1 -1
View File
@@ -24,7 +24,7 @@ export function loadConfig(): LlmConfig {
apiUrl: process.env.LLM_API_URL ?? "https://api.siliconflow.cn/v1/chat/completions", apiUrl: process.env.LLM_API_URL ?? "https://api.siliconflow.cn/v1/chat/completions",
apiKey: process.env.LLM_API_KEY ?? "", apiKey: process.env.LLM_API_KEY ?? "",
model: process.env.LLM_MODEL ?? "Qwen/Qwen2.5-32B-Instruct", 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),
}; };
} }