|
|
|
@ -6,9 +6,7 @@ namespace Lion.AbpPro.Extensions.Hangfire |
|
|
|
{ |
|
|
|
public static void CreateRecurringJob(this ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
using var scope = context.ServiceProvider.CreateScope(); |
|
|
|
var testJob = scope.ServiceProvider.GetService<TestJob>(); |
|
|
|
RecurringJob.AddOrUpdate("测试Job", () => testJob.ExecuteAsync(), CronType.Minute(1), TimeZoneInfo.Local); |
|
|
|
RecurringJob.AddOrUpdate<TestJob>("测试Job", t => t.ExecuteAsync(), CronType.Minute(1),TimeZoneInfo.Local); |
|
|
|
} |
|
|
|
} |
|
|
|
} |