refactor(schedule): 使计划管理器适配异步数据库操作

底层的计划数据访问函数已更改为异步实现。为确保正确的异步执行流程,本次提交对 PlanManager 中的所有相关调用进行了更新,添加了 await 关键字,并将 get_plans_for_schedule 方法声明为 async。
This commit is contained in:
tt-P607
2025-10-01 00:44:44 +08:00
committed by Windpicker-owo
parent f3697d56a8
commit d1c7757787

View File

@@ -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)