Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Use the DisallowConcurrentExecution attribute.</p> <p>Declare your class as follows:</p> <pre><code>[DisallowConcurrentExecution] public class SomeTask : IJob { } </code></pre> <p><strong>Misfires</strong></p> <blockquote> <p>"Misfire Instructions Another important property of a Trigger is its "misfire instruction". A misfire occurs if a persistent trigger "misses" its firing time because of the scheduler being shutdown, or because there are no available threads in Quartz.NET's thread pool for executing the job. The different trigger types have different misfire instructions available to them. By default they use a 'smart policy' instruction - which has dynamic behavior based on trigger type and configuration. When the scheduler starts, it searches for any persistent triggers that have misfired, and it then updates each of them based on their individually configured misfire instructions. When you start using Quartz.NET in your own projects, you should make yourself familiar with the misfire instructions that are defined on the given trigger types, and explained in their API documentation. More specific information about misfire instructions will be given within the tutorial lessons specific to each trigger type."</p> </blockquote> <p>Check out the "trigger misfire instructions" information at the bottom of these pages:</p> <p><a href="http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/simpletriggers.html" rel="noreferrer">Lesson 5: SimpleTrigger</a></p> <p><a href="http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontriggers.html" rel="noreferrer" title="Lesson 6: CronTrigger">Lesson 6: CronTrigger</a></p> <p><strong>Old Quartz.NET API answer:</strong></p> <p><a href="http://quartznet.sourceforge.net/apidoc/topic142.html" rel="noreferrer">http://quartznet.sourceforge.net/apidoc/topic142.html</a>:</p> <blockquote> <p><strong>IStatefulJob</strong> instances follow slightly different rules from regular IJob instances. The key difference is that their associated JobDataMap is re-persisted after every execution of the job, thus preserving state for the next execution. The other difference is that stateful jobs <strong>are not allowed to Execute concurrently</strong>, which means new triggers that occur before the completion of the IJob.Execute method will be delayed.</p> </blockquote> <p>So, declare your 'Job' class as follows:</p> <pre><code>class DocumentImportJob : IStatefulJob { ...... } </code></pre> <p>To avoid delayed tasks re-firing immediately after job completes (when the job takes more than 1 minute and causes a trigger 'misfire'), do the following when creating your trigger(s) (adjust depending on the trigger type used):</p> <pre><code>myJobTrigger.MisfireInstruction = MisfireInstruction.CronTrigger.DoNothing; </code></pre> <p><a href="https://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/more-about-triggers.html" rel="noreferrer">https://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/more-about-triggers.html</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload