Yes. You can get all the triggers for the task, compare them with the one that is running, and after they were scheduled after it, sort the task (the triggers will be deleted).
So, from your work:
public void Execute(IJobExecutionContext context)
{
var currentlyExecutingTrigger = context.Trigger;
var currentlyExecutingJobkey = context.JobDetail.Key;
var newTriggers = context.Scheduler.GetTriggersOfJob(key);
foreach (var newTrigger in newTriggers)
{
if (newTrigger.StartTimeUtc >= trigger.StartTimeUtc)
{
context.Scheduler.UnscheduleJob(newTrigger.Key);
}
}
}
source
share