refactor(person_info): 引入同步方法 get_value 并替换旧的 get_value_sync(因为根本就没有这个方法)
为了解决在不同异步上下文中同步调用数据库可能引发的运行时错误,实现了一个新的、更健壮的同步方法 `PersonInfoManager.get_value`。 - 新方法能够正确处理已在运行的 asyncio 事件循环,提高了在混合代码环境中调用的稳定性。 - 全面替换了原有的 `get_value_sync` 方法调用,统一了同步获取用户信息的接口。
This commit is contained in:
committed by
Windpicker-owo
parent
02067b6eeb
commit
79baac2797
@@ -965,7 +965,7 @@ class Prompt:
|
||||
person_info_manager = get_person_info_manager()
|
||||
person_id = person_info_manager.get_person_id_by_person_name(sender)
|
||||
if person_id:
|
||||
user_id = person_info_manager.get_value_sync(person_id, "user_id")
|
||||
user_id = person_info_manager.get_value(person_id, "user_id")
|
||||
return str(user_id) if user_id else ""
|
||||
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user