任务
- 执行1次,马上执行 BackgroundJob.Enqueue()
var jobId = BackgroundJob.Enqueue(
() => Console.WriteLine( "job" ));
- 延迟执行,多少时候后执行 BackgroundJob.Schedule()
var jobId = BackgroundJob.Schedule(
() => Console.WriteLine( "Delayed!" ),
TimeSpan.FromDays(7));
-定时执行 RecurringJob.AddOrUpdate()
RecurringJob.AddOrUpdate<Jobs.JcgcJob>(x => x.UpdateJiaTing(), "0 0 23 ? ? ? ", TimeZoneInfo.Local);
- 顺序执行 BackgroundJob .ContinueJobWith()
BackgroundJob.ContinueJobWith(
jobId,
() => Console.WriteLine("Continuation!"));
特性
- 失败火异常 重试次数
[AutomaticRetry(Attempts = 2)]