From d1c77577873474903c0b1ab9fba050c7d4fc8f7c Mon Sep 17 00:00:00 2001 From: tt-P607 <68868379+tt-P607@users.noreply.github.com> Date: Wed, 1 Oct 2025 00:44:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(schedule):=20=E4=BD=BF=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E7=AE=A1=E7=90=86=E5=99=A8=E9=80=82=E9=85=8D=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E6=95=B0=E6=8D=AE=E5=BA=93=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 底层的计划数据访问函数已更改为异步实现。为确保正确的异步执行流程,本次提交对 PlanManager 中的所有相关调用进行了更新,添加了 await 关键字,并将 get_plans_for_schedule 方法声明为 async。 --- src/schedule/plan_manager.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/schedule/plan_manager.py b/src/schedule/plan_manager.py index aac05ddfa..11e6b152f 100644 --- a/src/schedule/plan_manager.py +++ b/src/schedule/plan_manager.py @@ -102,7 +102,6 @@ class PlanManager: except Exception as e: logger.error(f" 归档 {target_month} 月度计划时发生错误: {e}") - @staticmethod - async def get_plans_for_schedule(month: str, max_count: int) -> List: + async def get_plans_for_schedule(self, month: str, max_count: int) -> List: avoid_days = global_config.planning_system.avoid_repetition_days - return get_smart_plans_for_daily_schedule(month, max_count=max_count, avoid_days=avoid_days) + return await get_smart_plans_for_daily_schedule(month, max_count=max_count, avoid_days=avoid_days)