[changes] AI reviews and modifies the code
This commit is contained in:
@@ -115,8 +115,8 @@ class EndUserRepository:
|
|||||||
end_user_info = EndUserInfo(
|
end_user_info = EndUserInfo(
|
||||||
end_user_id=end_user.id,
|
end_user_id=end_user.id,
|
||||||
other_name=other_name or "", # 如果没有提供 other_name,使用空字符串
|
other_name=other_name or "", # 如果没有提供 other_name,使用空字符串
|
||||||
aliases={}, # 空字典而不是 None
|
aliases=[],
|
||||||
meta_data={} # 空字典而不是 None
|
meta_data=[]
|
||||||
)
|
)
|
||||||
self.db.add(end_user_info)
|
self.db.add(end_user_info)
|
||||||
|
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ class UserMemoryService:
|
|||||||
if aliases_updated:
|
if aliases_updated:
|
||||||
try:
|
try:
|
||||||
import asyncio
|
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']}")
|
logger.info(f"已触发 aliases 同步到 Neo4j: end_user_id={end_user_id}, aliases={update_data['aliases']}")
|
||||||
except Exception as sync_error:
|
except Exception as sync_error:
|
||||||
logger.error(f"触发同步 aliases 到 Neo4j 失败: {sync_error}", exc_info=True)
|
logger.error(f"触发同步 aliases 到 Neo4j 失败: {sync_error}", exc_info=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user