perf(methods): 通过移除不必要的 self 参数优化方法签名
在包括 chat、plugin_system、schedule 和 mais4u 在内的多个模块中,消除冗余的实例引用。此次改动将无需访问实例状态的实用函数转换为静态方法,从而提升了内存效率,并使方法依赖关系更加清晰。
This commit is contained in:
@@ -838,7 +838,7 @@ class EntorhinalCortex:
|
||||
timestamp_start = target_timestamp
|
||||
timestamp_end = target_timestamp + time_window_seconds
|
||||
|
||||
if chosen_message := get_raw_msg_by_timestamp(
|
||||
if chosen_message := await get_raw_msg_by_timestamp(
|
||||
timestamp_start=timestamp_start,
|
||||
timestamp_end=timestamp_end,
|
||||
limit=1,
|
||||
@@ -846,7 +846,7 @@ class EntorhinalCortex:
|
||||
):
|
||||
chat_id: str = chosen_message[0].get("chat_id") # type: ignore
|
||||
|
||||
if messages := get_raw_msg_by_timestamp_with_chat(
|
||||
if messages := await get_raw_msg_by_timestamp_with_chat(
|
||||
timestamp_start=timestamp_start,
|
||||
timestamp_end=timestamp_end,
|
||||
limit=chat_size,
|
||||
|
||||
Reference in New Issue
Block a user