From e0063fb281eebe2773f18d73a72168fb5d2444f0 Mon Sep 17 00:00:00 2001 From: Windpicker-owo <3431391539@qq.com> Date: Sat, 1 Nov 2025 19:34:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E8=8E=B7=E5=8F=96=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E6=B5=81=E6=97=B6=E6=B7=BB=E5=8A=A0=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=92=8C=E6=9C=80=E5=90=8E=E6=B4=BB=E8=B7=83?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/message_receive/chat_stream.py | 3 +++ src/person_info/relationship_fetcher.py | 6 ++++++ 2 files changed, 9 insertions(+) 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: