private static IJobDetail CreateJob(JobMetadata jobMetadata) { return(JobBuilder .Create(jobMetadata.JobType) .WithDescription(jobMetadata.JobType.Name) .Build()); }
private static ITrigger CreateTrigger(JobMetadata jobMetadata) { return(TriggerBuilder .Create() .WithCronSchedule(jobMetadata.CronExpression) .WithDescription(jobMetadata.JobType.Name) .Build()); }
public TimerHostedService( ISchedulerFactory schedulerFactory, IJobFactory jobFactory, JobMetadata jobMetadata) { _schedulerFactory = schedulerFactory; _jobFactory = jobFactory; _jobMetadata = jobMetadata; }