fix: 调整兴趣匹配计算超时设置和消息读取限制,优化性能

This commit is contained in:
Windpicker-owo
2025-12-10 11:58:29 +08:00
parent c2c3c062b7
commit cc531d1b97
2 changed files with 2 additions and 2 deletions

View File

@@ -395,7 +395,7 @@ async def _calculate_interest_match_score(self, content: str, keywords: list[str
except asyncio.TimeoutError: except asyncio.TimeoutError:
# 超时时返回默认分值 0.5 # 超时时返回默认分值 0.5
logger.warning("⏱️ 兴趣匹配计算超时(>1.5秒)返回默认分值0.5以保留其他分数") logger.warning("⏱️ 兴趣匹配计算超时(>5秒)返回默认分值0.5以保留其他分数")
return 0.5 # 避免丢失提及分和关系分 return 0.5 # 避免丢失提及分和关系分
except Exception as e: except Exception as e:

View File

@@ -15,7 +15,7 @@ from src.config.config import global_config
logger = get_logger(__name__) logger = get_logger(__name__)
SAFE_FETCH_LIMIT = 5000 # 防止一次性读取过多行导致内存暴涨 SAFE_FETCH_LIMIT = 1000 # 防止一次性读取过多行导致内存暴涨
class Base(DeclarativeBase): class Base(DeclarativeBase):