mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-23 04:09:59 +00:00
fix: 性能优化,CPU 密集型计算(统计和分析)已卸载到各线程池,避免阻塞事件循环
feat: 存储路径规范化:PDF 报告现在存储在 data/plugin_data/astrbot_plugin_qq_group_daily_analysis/reports
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
包含消息分析和其他通用功能
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
from astrbot.api import logger
|
||||
|
||||
from ...src.analysis.llm_analyzer import LLMAnalyzer
|
||||
@@ -49,10 +50,14 @@ class MessageAnalyzer:
|
||||
"""完整的消息分析流程"""
|
||||
try:
|
||||
# 基础统计
|
||||
statistics = self.message_handler.calculate_statistics(messages)
|
||||
statistics = await asyncio.to_thread(
|
||||
self.message_handler.calculate_statistics, messages
|
||||
)
|
||||
|
||||
# 用户分析
|
||||
user_analysis = self.user_analyzer.analyze_users(messages)
|
||||
user_analysis = await asyncio.to_thread(
|
||||
self.user_analyzer.analyze_users, messages
|
||||
)
|
||||
|
||||
# 获取活跃用户列表 - 使用get_top_users方法,limit从配置中读取
|
||||
max_user_titles = self.config_manager.get_max_user_titles()
|
||||
|
||||
Reference in New Issue
Block a user