feat: 在获取聊天流时添加创建时间和最后活跃时间字段

This commit is contained in:
Windpicker-owo
2025-11-01 19:34:51 +08:00
parent cd42fc1b5e
commit e0063fb281
2 changed files with 9 additions and 0 deletions

View File

@@ -257,14 +257,20 @@ class RelationshipFetcher:
"""
try:
from src.common.database.api.specialized import get_or_create_chat_stream
import time
# 使用优化后的API带缓存
# 从stream_id解析platform或使用默认值
platform = stream_id.split("_")[0] if "_" in stream_id else "unknown"
current_time = time.time()
stream, _ = await get_or_create_chat_stream(
stream_id=stream_id,
platform=platform,
defaults={
"create_time": current_time,
"last_active_time": current_time,
},
)
if not stream: