mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-22 13:38:43 +00:00
[fix] (debug) 纠正日志等级情况,纠正不能适配低版本的的 async timeout 方法
This commit is contained in:
@@ -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):
|
||||
"""插件被卸载/停用时调用,清理资源"""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user