Kalpa-W
Kalpa-W

Reputation: 358

How do I get the existing schedules and edit the trigger on quartz.net?

How can I get the existing schedules from quartz.net and edit one of the triggers firing time? Please advice. I am new to quartz.net and there is nothing exmplained about this in Quartz.net documentation.

Upvotes: 0

Views: 1438

Answers (1)

BRAHIM Kamel
BRAHIM Kamel

Reputation: 13794

you can try something like this

var allTriggerKeys = sched.GetTriggerKeys(GroupMatcher<TriggerKey>.AnyGroup());
foreach (var triggerKey in allTriggerKeys)
{
    ITrigger trigger = sched.GetTrigger(triggerKey);
    if(trigger.JobName=="yourtriggername", trigger.JobGroup=="yourjobgroupname")
       {
            scheduler.RescheduleJob(trigger.JobName, trigger.JobGroup, trigger);
       }
} 

Upvotes: 2

Related Questions