|
@@ -137,12 +137,17 @@ class AlarmPlanManager:
|
|
|
def _cron_scheduler(self):
|
|
|
import datetime
|
|
|
last_run_map = {} # {plan_uuid: date} 记录任务上次执行日期,避免重复跑
|
|
|
+ last_reset_date = None # 上一次重置的日期
|
|
|
+
|
|
|
while self.running:
|
|
|
now = datetime.datetime.now()
|
|
|
today = now.date()
|
|
|
|
|
|
# 每天 00:00 重置执行标记
|
|
|
- # todo
|
|
|
+ if last_reset_date != today:
|
|
|
+ last_run_map.clear()
|
|
|
+ last_reset_date = today
|
|
|
+ LOGINFO(f"[CronScheduler] reset last_run_map at {today}")
|
|
|
|
|
|
plans = self.list_all_cron()
|
|
|
plan: AlarmPlan = None
|