diff --git a/main.py b/main.py index c1d0560..8652bc0 100644 --- a/main.py +++ b/main.py @@ -79,7 +79,7 @@ class QQGroupDailyAnalysis(Star): logger.info(f"Bot管理器状态: {status}") except Exception as e: - logger.error(f"延迟启动调度器失败: {e}") + logger.debug(f"延迟启动调度器失败,可能由于短时间内多次更新插件配置: {e}") async def terminate(self): """插件被卸载/停用时调用,清理资源""" diff --git a/src/analysis/llm_analyzer.py b/src/analysis/llm_analyzer.py index bd5bb34..3ad0d27 100644 --- a/src/analysis/llm_analyzer.py +++ b/src/analysis/llm_analyzer.py @@ -253,7 +253,7 @@ class LLMAnalyzer: else: logger.warning(f"话题分析响应中未找到JSON格式,响应内容: {result_text[:200]}...") except json.JSONDecodeError as e: - logger.error(f"话题分析JSON解析失败: {e}") + logger.debug(f"话题分析JSON解析失败: {e}") logger.debug(f"修复后的JSON: {json_text if 'json_text' in locals() else 'N/A'}") logger.debug(f"原始响应: {result_text}") @@ -467,7 +467,7 @@ class LLMAnalyzer: titles_data = json.loads(json_match.group()) return [UserTitle(**title) for title in titles_data], token_usage except Exception as e: - logger.error(f"用户称号分析JSON解析失败: {e}") + logger.debug(f"用户称号分析JSON解析失败: {e}") logger.debug(f"原始响应: {result_text}") return [], token_usage @@ -570,7 +570,7 @@ class LLMAnalyzer: quotes_data = json.loads(json_match.group()) return [GoldenQuote(**quote) for quote in quotes_data[:max_golden_quotes]], token_usage except Exception as e: - logger.error(f"金句分析JSON解析失败: {e}") + logger.debug(f"金句分析JSON解析失败: {e}") logger.debug(f"原始响应: {result_text}") return [], token_usage diff --git a/src/scheduler/auto_scheduler.py b/src/scheduler/auto_scheduler.py index 51a8834..1647f1f 100644 --- a/src/scheduler/auto_scheduler.py +++ b/src/scheduler/auto_scheduler.py @@ -157,9 +157,8 @@ class AutoScheduler: async def _perform_auto_analysis_for_group_with_timeout(self, group_id: str): """为指定群执行自动分析(带超时控制)""" try: - # 为每个群聊设置独立的超时时间(20分钟) - async with asyncio.timeout(1200): - await self._perform_auto_analysis_for_group(group_id) + # 为每个群聊设置独立的超时时间(20分钟)- 使用 asyncio.wait_for 兼容所有 Python 版本 + await asyncio.wait_for(self._perform_auto_analysis_for_group(group_id), timeout=1200) except asyncio.TimeoutError: logger.error(f"群 {group_id} 分析超时(20分钟),跳过该群分析") except Exception as e: