feat(context_manager): 移除消息添加和标记已读的日志记录,简化代码

This commit is contained in:
Windpicker-owo
2025-11-10 21:55:16 +08:00
parent f3af3caf71
commit 1b93cc3d63
4 changed files with 4 additions and 18 deletions

View File

@@ -83,11 +83,6 @@ class SingleStreamContextManager:
self.total_messages += 1
self.last_access_time = time.time()
# 记录消息添加日志
msg_preview = message.processed_plain_text[:30] if message.processed_plain_text else "(无内容)"
msg_id_str = str(message.message_id)[:8] if message.message_id else "unknown"
logger.info(f" [添加消息] {msg_id_str}: {msg_preview}..., 当前未读数: {len(self.context.unread_messages)}, 历史数: {len(self.context.history_messages)}")
# 如果使用了缓存系统,输出调试信息
if cache_enabled and self.context.is_cache_enabled:
if self.context.is_chatter_processing:

View File

@@ -91,7 +91,6 @@ class MessageManager:
async def add_message(self, stream_id: str, message: DatabaseMessages):
"""添加消息到指定聊天流"""
try:
# 检查是否为notice消息
if self._is_notice_message(message):

View File

@@ -211,10 +211,10 @@ class StatisticOutputTask(AsyncTask):
try:
now = datetime.now()
logger.info("正在收集统计数据(异步)...")
stats = await self._collect_all_statistics(now)
stats = await asyncio.create_task(self._collect_all_statistics(now))
logger.info("统计数据收集完成")
self._statistic_console_output(stats, now)
await self._generate_html_report(stats, now)
self._statistic_console_output(stats, n ow)
await asyncio.create_task(self._generate_html_report(stats, now))
logger.info("统计数据输出完成")
except Exception as e:
logger.exception(f"输出统计数据过程中发生异常,错误信息:{e}")