Files
Web_Faces_Prod/Face.SystemTask/TimingPlan/TimingPlanRegistry.cs
2025-11-25 17:41:57 +08:00

37 lines
1.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using FluentScheduler;
namespace Face.SystemTask
{
/// <summary>
/// 定时作业计划注册管理
/// </summary>
public class TimingPlanRegistry : Registry
{
/// <summary>
/// 定时作业计划注册 自定义
/// </summary>
public TimingPlanRegistry()
{
//NonReentrant防止并发ToRunNow指定并立即执行后重复执行ToRunEvery指定后重复执行,ToRunOnceIn指定后执行一次
//Schedule<TimingPlanJob.PlanJob1>().WithName(Enum.TimingPlan.Plan1.ToString()).NonReentrant().ToRunEvery(30).Seconds();
//Schedule<TimingPlanJob.PlanJob2>().WithName(Enum.TimingPlan.Plan2.ToString()).NonReentrant().ToRunEvery(1).Minutes();
//Schedule<TimingPlanJob.PlanJob3>().WithName(Enum.TimingPlan.Plan3.ToString()).NonReentrant().ToRunEvery(1).Days().At(14, 25);
//Schedule<TimingPlanJob.PlanJob4>().WithName(Enum.TimingPlan.Plan4.ToString()).NonReentrant().ToRunEvery(1).Weekdays().At(14, 25);
//Schedule<TimingPlanJob.PlanJob4>().WithName(Enum.TimingPlan.Plan5.ToString()).NonReentrant().ToRunEvery(1).Months().On(16).At(14, 23);
//一分钟执行一次
Schedule<TimingPlanJob.CustomPlanJob1>().WithName("CustomTimingPlan1").NonReentrant().ToRunEvery(1).Minutes();
//60秒
//Schedule<TimingPlanJob.CustomPlanJob2>().WithName("CustomTimingPlan2").NonReentrant().ToRunEvery(60).Seconds();
//一分钟
//Schedule<TimingPlanJob.CustomPlanJob3>().WithName("CustomTimingPlan3").NonReentrant().ToRunEvery(1).Minutes();
}
}
}