Пример #1
0
 private IJobDetail CreateJob(QuartzDTO quartzDTO)
 {
     return(JobBuilder
            .Create <PrintToConsoleJob>()
            .WithIdentity(quartzDTO.Id, quartzDTO.Group)
            .Build());
 }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
 private ITrigger CreateTrigger(QuartzDTO quartzDTO)
 {
     return(TriggerBuilder.Create()
            .WithIdentity(quartzDTO.Id, quartzDTO.Group)
            .WithCronSchedule(quartzDTO.CronExpression)
            .WithDescription(quartzDTO.Description)
            .Build());
 }
Пример #5
0
 private IJobDetail CreateJob(QuartzDTO quartzDTO)
 {
     return(JobBuilder
            .Create <RunBuildJob>()
            .WithIdentity(quartzDTO.Id, quartzDTO.Group)
            .WithDescription(quartzDTO.Description)
            .Build());
 }
Пример #6
0
 public async Task DeletScheduleJob(QuartzDTO quartzDTO)
 {
     TriggerKey triggerKey = new TriggerKey(quartzDTO.Id, quartzDTO.Group);
     await _scheduler.UnscheduleJob(triggerKey);
 }