Пример #1
0
 private IJobDetail CreateJob(JobMetadata jobMetadata)
 {
     return(JobBuilder
            .Create(jobMetadata.JobType)
            .WithIdentity(jobMetadata.JobId.ToString())
            .WithDescription($"{jobMetadata.JobName}")
            .Build());
 }
 private ITrigger CreateTrigger(JobMetadata jobMetadata)
 {
     return(TriggerBuilder.Create()
            .WithIdentity(jobMetadata.JobId.ToString())
            .WithCronSchedule(jobMetadata.CronExpression)
            .WithDescription($"{jobMetadata.JobName}")
            .Build());
 }
Пример #3
0
 private ITrigger CreateTrigger(JobMetadata jobMetadata)
 {
     return(TriggerBuilder.Create()
            .WithIdentity(jobMetadata.JobId.ToString())
            .WithCronSchedule(jobMetadata.CronExpression)
            .WithDescription($"{jobMetadata.JobName}")
            .WithDailyTimeIntervalSchedule(s => s.InTimeZone(jobMetadata.TimeZoneInfo))
            .Build());
 }
Пример #4
0
 public QuartzMultaHostedService(ISchedulerFactory
                                 schedulerFactory,
                                 JobMetadata jobMetadata,
                                 IJobFactory jobFactory)
 {
     this.schedulerFactory = schedulerFactory;
     this.jobMetadata      = jobMetadata;
     this.jobFactory       = jobFactory;
 }