[changes] AI reviews and modifies the code

This commit is contained in:
lanceyq
2026-03-25 18:57:35 +08:00
parent 2a12cb04bf
commit 65b2f9e6e1
2 changed files with 3 additions and 3 deletions

View File

@@ -115,8 +115,8 @@ class EndUserRepository:
end_user_info = EndUserInfo(
end_user_id=end_user.id,
other_name=other_name or "", # 如果没有提供 other_name使用空字符串
aliases={}, # 空字典而不是 None
meta_data={} # 空字典而不是 None
aliases=[],
meta_data=[]
)
self.db.add(end_user_info)

View File

@@ -510,7 +510,7 @@ class UserMemoryService:
if aliases_updated:
try:
import asyncio
asyncio.create_task(self._sync_aliases_to_neo4j(end_user_id, update_data['aliases']))
asyncio.run(self._sync_aliases_to_neo4j(end_user_id, update_data['aliases']))
logger.info(f"已触发 aliases 同步到 Neo4j: end_user_id={end_user_id}, aliases={update_data['aliases']}")
except Exception as sync_error:
logger.error(f"触发同步 aliases 到 Neo4j 失败: {sync_error}", exc_info=True)