重启调度任务

This commit is contained in:
2025-06-05 10:23:15 +08:00
parent 4b7920fc60
commit bdae3f56af
7 changed files with 59 additions and 16 deletions

View File

@@ -469,5 +469,23 @@ namespace MyCode.Project.Services.Implementation
}
}
#endregion
#region RetryTask()
/// <summary>
/// 重试失败的任务
/// </summary>
public void RetryTask()
{
DateTime today = DateTime.Now.Date.AddDays(-1);
var list = _sysWorkProcessV2Repository.Queryable().Where(t => t.FuncStatus == 4 && t.RetryCount <= 10
&& t.CreateTime >= today).OrderBy(t => t.EditTime).Take(20).ToList();
list.ForEach(t =>
{
t.RetryCount = t.RetryCount + 1;
t.FuncStatus = 0;
});
_sysWorkProcessV2Repository.Update(list);
}
#endregion
}
}