Quartz.net repeats the task in the interval after the completion of the task

I am currently implementing Quartz.net in a simple application that should execute a piece of code every (for example) 5 seconds. Only now, the code may take more than 5 seconds.

At first I had a problem with the code being executed while the same code was still working, I fixed it using the IStateFulJob interface, not the IJob interface.

But I would like for my work to be done after 5 seconds AFTER the completion of the task, and not 5 seconds after starting my previous task.

Of course, I could handle the event that fires when my listener β€œhears” that the task is ready and redistributes the task, but I was wondering if it had standard functions.

+6
c # quartz-scheduler scheduling
source share
1 answer

Currently, there is no standard way to achieve this, since Quartz.NET plays on the idea of ​​having a predetermined (pre-calculated) fire time and polling at the right time to start work.

What you described would be the easiest way. Either the schedule from the task of the next performance, or from the listener.

+4
source share

All Articles