更新计划时清零计数器
This commit is contained in:
@@ -296,6 +296,10 @@ func (c *Controller) UpdatePlan(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
// 5. 调用仓库方法更新计划
|
||||
// 只要是更新任务,就重置执行计数器
|
||||
planToUpdate.ExecuteCount = 0 // 重置计数器
|
||||
c.logger.Infof("计划 #%d 被更新,执行计数器已重置为 0。", planToUpdate.ID)
|
||||
|
||||
if err := c.planRepo.UpdatePlan(planToUpdate); err != nil {
|
||||
controller.SendErrorResponse(ctx, controller.CodeBadRequest, "更新计划失败: "+err.Error())
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user