How to make a trigger wait for the end to start Quartz C # again
I am using Quartz 2.5.0.0
And I have the following code to run whatever job I want. All my work is in the folder, since I just take it there.
var scheduler = StdSchedulerFactory.GetDefaultScheduler();
scheduler.Start();
var t = new ImportingLib.Importer();
t.DoImport();
foreach (var component in t.CallAllComponents())
{
var job = JobBuilder.Create(component)
.WithIdentity(component.Name)
.Build();
var trigger = TriggerBuilder.Create()
.WithIdentity($"{component.Name}Trigger")
.StartNow()
.WithSimpleSchedule(x => x
.WithIntervalInSeconds(10)
.RepeatForever())
.ForJob(component.Name)
.Build();
scheduler.ScheduleJob(job, trigger);
}
I want this job to be done every 10 seconds, but I need to wait for it to finish, right after that, run the same Job again. A way to learn how to work with protectors, but I haven't found how to do it. Any idea how I can get it to work?
+3
source to share