定时器执行
This commit is contained in:
@@ -203,6 +203,7 @@ namespace WMS.Web.Repositories.DependencyInjection
|
||||
Services.AddTransient<MaterialsQuartzJob>();//添加注入定时服务
|
||||
Services.AddTransient<ErpDeleteQuartzJob>();//添加注入定时服务
|
||||
//Services.AddTransient<OrderContractQuartzJob>();//添加注入定时服务
|
||||
Services.AddTransient<InventoryQuartzJob>();//添加注入定时服务
|
||||
Services.AddQuartz(q =>
|
||||
{
|
||||
q.UsePersistentStore(x =>
|
||||
@@ -301,6 +302,18 @@ namespace WMS.Web.Repositories.DependencyInjection
|
||||
//.WithCronSchedule(CronScheduleBuilder.DailyAtHourAndMinute(options.JobStartHour[5], options.JobStartMinute[5]))
|
||||
.WithDescription("ErpDeleteQuartzJobTriggerDecs"));
|
||||
#endregion
|
||||
|
||||
#region 成品即时库存
|
||||
var jobKey_Inventory = new JobKey("InventoryQuartzJob", options.QuartzJobValue);
|
||||
q.AddJob<InventoryQuartzJob>(jobKey, j => j.WithDescription("InventoryQuartzJob"));
|
||||
q.AddTrigger(t => t
|
||||
.WithIdentity("InventoryQuartzJobTrigger")
|
||||
.ForJob(jobKey)
|
||||
.StartNow()
|
||||
.WithCronSchedule(options.JobStartExpre)
|
||||
//.WithCronSchedule(CronScheduleBuilder.DailyAtHourAndMinute(options.JobStartHour[5], options.JobStartMinute[5]))
|
||||
.WithDescription("InventoryQuartzJobTriggerDecs"));
|
||||
#endregion
|
||||
});
|
||||
//.net core核心托管-添加Quartz服务器
|
||||
Services.AddQuartzServer(options =>
|
||||
|
||||
Reference in New Issue
Block a user