diff --git a/src/chat/message_receive/chat_stream.py b/src/chat/message_receive/chat_stream.py index 782ff757b..4e583e8e7 100644 --- a/src/chat/message_receive/chat_stream.py +++ b/src/chat/message_receive/chat_stream.py @@ -444,10 +444,13 @@ class ChatManager: return stream # 使用优化后的API查询(带缓存) + current_time = time.time() model_instance, _ = await get_or_create_chat_stream( stream_id=stream_id, platform=platform, defaults={ + "create_time": current_time, + "last_active_time": current_time, "user_platform": user_info.platform if user_info else platform, "user_id": user_info.user_id if user_info else "", "user_nickname": user_info.user_nickname if user_info else "", diff --git a/src/person_info/relationship_fetcher.py b/src/person_info/relationship_fetcher.py index fbf98436f..d2e61467c 100644 --- a/src/person_info/relationship_fetcher.py +++ b/src/person_info/relationship_fetcher.py @@ -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: