Search code examples
quartz.netquartz

Quartz net - Not working as expected


I have used the Quartz net expression for the following scenario that Schedule should run every 40 seconds.

I have added the expression like following.

0/40 * * * * ?

I expected this to run on every 40 seconds. Instead of that, it runs like, for the 40th seconds it runs, then it runs when next minutes starts.

enter image description here


Solution

  • I do not know the specifics of Quartz.net but your understanding of what a cron expression does is wrong.

    The / syntax specifies an increment in the period selected and not a repeat. So you are effectively asking for a job to run at second 0 and second 40 of every minute of every hour of ...

    Given what you want, you should use a simple trigger with a repeat interval.