定时任务
This commit is contained in:
@@ -196,6 +196,7 @@ namespace WMS.Web.Repositories.DependencyInjection
|
||||
Services.AddTransient<InStockOrderQuartzJob>();//添加注入定时服务
|
||||
Services.AddTransient<OutStockOrderQuartzJob>();//添加注入定时服务
|
||||
Services.AddTransient<BoxQuartzJob>();//添加注入定时服务
|
||||
Services.AddTransient<SendQuartzJob>();//添加注入定时服务
|
||||
//Services.AddTransient<OrderContractQuartzJob>();//添加注入定时服务
|
||||
Services.AddQuartz(q =>
|
||||
{
|
||||
@@ -259,6 +260,18 @@ namespace WMS.Web.Repositories.DependencyInjection
|
||||
//.WithCronSchedule(CronScheduleBuilder.DailyAtHourAndMinute(options.JobStartHour[5], options.JobStartMinute[5]))
|
||||
.WithDescription("BoxQuartzJobTriggerDecs"));
|
||||
#endregion
|
||||
|
||||
#region 发送通知信息
|
||||
var jobKey_send = new JobKey("SendQuartzJob", options.QuartzJobValue);
|
||||
q.AddJob<SendQuartzJob>(jobKey_box, j => j.WithDescription("SendQuartzJob"));
|
||||
q.AddTrigger(t => t
|
||||
.WithIdentity("SendQuartzJobTrigger")
|
||||
.ForJob(jobKey_send)
|
||||
.StartNow()
|
||||
.WithCronSchedule(options.JobStartExpreSend)
|
||||
//.WithCronSchedule(CronScheduleBuilder.DailyAtHourAndMinute(options.JobStartHour[5], options.JobStartMinute[5]))
|
||||
.WithDescription("SendQuartzJobTriggerDecs"));
|
||||
#endregion
|
||||
});
|
||||
//.net core核心托管-添加Quartz服务器
|
||||
Services.AddQuartzServer(options =>
|
||||
|
||||
Reference in New Issue
Block a user