issue_10 #12

Merged
huang merged 11 commits from issue_10 into main 2025-09-23 21:35:54 +08:00
Showing only changes of commit 25d6855b38 - Show all commits

View File

@@ -437,7 +437,12 @@ func (s *Scheduler) handlePlanCompletion(planLogID uint) {
}
// 6. 调用共享的 Manager 来处理触发器更新逻辑
if err := s.analysisPlanTaskManager.CreateOrUpdateTrigger(topLevelPlanID); err != nil {
s.logger.Errorf("为计划 %d 创建/更新触发器失败: %v", topLevelPlanID, err)
// 只有当计划在本次执行后仍然是 Enabled 状态时,才需要创建下一次的触发器。
if newStatus == models.PlanStatusEnabled {
if err := s.analysisPlanTaskManager.CreateOrUpdateTrigger(topLevelPlanID); err != nil {
s.logger.Errorf("为计划 %d 创建/更新触发器失败: %v", topLevelPlanID, err)
} else {
s.logger.Infof("计划 %d 状态为 '%d',无需创建下一次触发器。", topLevelPlanID, newStatus)
}
}
}