bbush bbush - 14 days ago 5
C# Question

Conditional Job Chaining in Quartz.NET

Suppose that I have two jobs A and B. They both execute on different intervals which may end up overlapping. For example, if A executes every 10 seconds and B executes every 15 seconds, then every 30 seconds their execution will coincide.

I want to ensure that if their execution does end up coinciding, job A always happens first.

I'm attempting to determine a good way to set this up in Quartz.NET (2.x), but would appreciate any insight.

Answer

It turns out that you can set a priority value on Triggers so that if they have the same fire time, the Trigger with the highest priority is executed first.

See : http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/more-about-triggers.html