I am using Quartz.NET. and Quartz.Spi.MongoDbJobStore v 3.1.0
I run into the following issue: imagine Job that have triggers in past. To be more specific: today is 1/20/2022, so lets say trigger
StartTime 2021-12-27 01:00:00.000Z
EndTime 2021-12-27 01:00:00.000Z
NextFireTime 2021-12-27 01:00:00.000Z
This case is possible if for some reason my server was turned off (or down) at the time the trigger should fire.
Once I turn the server on back (after EndTime 2021-12-27 01:00:00.000Z) I want Quartz puck up the missed trigger and fire it right away.
So Quartz.Spi.MongoDbJobStore calls Quartz.Spi.MongoDbJobStore.Models.CalendarIntervalTrigger.GetTrigger() (for Cron triggers there is similar flow)
The method creates new CalendarIntervalTrigger() and then tries to FillTrigger().
As we see StartTime for new CalendarIntervalTrigger is not provided. So by default Quartz thru getter returns SystemTime.UtcNow() - let it be as of today 2022-01-22 03:55:00.000Z
Later when in FillTrigger() we assign EndTime (which is 2021-12-27 01:00:00.000Z) before we assing StartTime (2022-01-22 03:55:00.000Z)
then Quartz throws an exception with message "End time cannot be before start time" because of the logic it has in setter
So in FillTrigger() we need assign first StartTime then EndTime
I am using Quartz.NET. and Quartz.Spi.MongoDbJobStore v 3.1.0 I run into the following issue: imagine Job that have triggers in past. To be more specific: today is 1/20/2022, so lets say trigger StartTime 2021-12-27 01:00:00.000Z EndTime 2021-12-27 01:00:00.000Z NextFireTime 2021-12-27 01:00:00.000Z This case is possible if for some reason my server was turned off (or down) at the time the trigger should fire. Once I turn the server on back (after EndTime 2021-12-27 01:00:00.000Z) I want Quartz puck up the missed trigger and fire it right away. So Quartz.Spi.MongoDbJobStore calls Quartz.Spi.MongoDbJobStore.Models.CalendarIntervalTrigger.GetTrigger() (for Cron triggers there is similar flow) The method creates new CalendarIntervalTrigger() and then tries to FillTrigger(). As we see StartTime for new CalendarIntervalTrigger is not provided. So by default Quartz thru getter returns SystemTime.UtcNow() - let it be as of today 2022-01-22 03:55:00.000Z Later when in FillTrigger() we assign EndTime (which is 2021-12-27 01:00:00.000Z) before we assing StartTime (2022-01-22 03:55:00.000Z) then Quartz throws an exception with message "End time cannot be before start time" because of the logic it has in setter
So in FillTrigger() we need assign first StartTime then EndTime