private IJobDetail CreateJob(QuartzDTO quartzDTO) { return(JobBuilder .Create <PrintToConsoleJob>() .WithIdentity(quartzDTO.Id, quartzDTO.Group) .Build()); }
public async Task <QuartzInfoDTO> UpdateScheduleJob(QuartzDTO quartzDTO) { TriggerKey triggerKey = new TriggerKey(quartzDTO.Id, quartzDTO.Group); var trigger = CreateTrigger(quartzDTO); await _scheduler.RescheduleJob(triggerKey, trigger); return(await GetByTriggerIdAndProjectId(quartzDTO.Id, quartzDTO.Group)); }
public async Task <QuartzInfoDTO> AddScheduleJob(QuartzDTO quartzDTO) { var job = CreateJob(quartzDTO); var trigger = CreateTrigger(quartzDTO); await _scheduler.ScheduleJob(job, trigger); return(await GetByTriggerIdAndProjectId(quartzDTO.Id, quartzDTO.Group)); }
private ITrigger CreateTrigger(QuartzDTO quartzDTO) { return(TriggerBuilder.Create() .WithIdentity(quartzDTO.Id, quartzDTO.Group) .WithCronSchedule(quartzDTO.CronExpression) .WithDescription(quartzDTO.Description) .Build()); }
private IJobDetail CreateJob(QuartzDTO quartzDTO) { return(JobBuilder .Create <RunBuildJob>() .WithIdentity(quartzDTO.Id, quartzDTO.Group) .WithDescription(quartzDTO.Description) .Build()); }
public async Task DeletScheduleJob(QuartzDTO quartzDTO) { TriggerKey triggerKey = new TriggerKey(quartzDTO.Id, quartzDTO.Group); await _scheduler.UnscheduleJob(triggerKey); }