refactor(schedule): 使计划管理器适配异步数据库操作
底层的计划数据访问函数已更改为异步实现。为确保正确的异步执行流程,本次提交对 PlanManager 中的所有相关调用进行了更新,添加了 await 关键字,并将 get_plans_for_schedule 方法声明为 async。
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user