[fix] (llm_analyzer) 使用此前定义的变量 last_exc

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
This commit is contained in:
Helian Nuits
2025-09-11 22:15:16 +08:00
committed by GitHub
co-authored by sourcery-ai[bot]
parent 94e5777840
commit 8d0b21045d
+1 -2
View File
@@ -72,8 +72,7 @@ class LLMAnalyzer:
logger.warning(f"LLM请求超时: 第{attempt}次, timeout={timeout}s")
except Exception as e:
last_exc = e
logger.warning(f"LLM请求失败: 第{attempt}次, 错误: {e}")
logger.warning(f"LLM请求失败: 第{attempt}次, 错误: {last_exc}")
# 若非最后一次,等待退避后重试
if attempt < retries:
await asyncio.sleep(backoff * attempt)