Quartz.NET and daylight savings issue - quartz.net

We have a Quartz.NET cron trigger setup that needs to execute a job using the following schedule:
At 02:00hrs in the merchants time zone daily
However, when Daylight Savings Time (DST) occurs abnormalities occur i.e:
When the merchants timezone moves from +2 GMT to +3 GMT, the job does not get executed.
When the merchants timezone moves from +3 GMT to +2 GMT, the job does gets executed twice.
We already know that this behaviour is by design (http://www.quartz-scheduler.net/faq.html#daylight) but what are people using as a solution to this DST issue?
Cheers
Billy Stack

The link you point to may have been updated in the three years or so (!) since you asked this question. It would appear that the job should not be executed twice.
I'm unsure whether 02:00 officially 'occurs' in the US when daylight savings starts, so the concern about the job skipping execution at 02:00 could be resolved by setting it to 01:59:59 (cron trigger "59 59 1 ? *"), as long as you were in North America. Other countries may change at a different time of night. In Europe, for instance, the change is at 01:00, so there it would be better to set the trigger to 02:00:01

Just experienced the same issue as well, although in my case the trigger was not scheduled to fire between 0:00 and the DST change time (2:00 in the US). Instead, I had a job that runs MON-FRI at 8 in the morning, so it ran twice on the Monday November the 5th, the day following the DST change day.
If you read the FAQ item linked to in the question, it kinda makes sense. The Cron trigger wakes up, fires the job, then calculates next time to wake up. When it woke up on Friday at 8am, it calculated next time to run as Monday at 8am. However, by Monday morning what used to be 8am became 7am, so the trigger fired at that time. And then when it ran, the next time was "correctly" calculated as 8am, so it ran again at that time also.
Hope this helps somebody struggling to understand the issue.

Jobs run twice in the fall and don't run at all in the spring. It doesn't matter what time they are scheduled. The question was and still is, "How do you stop this from happening?" If you manually delete all jobs after the time change and before they run then add them back then it works fine. I haven't looked at it yet but thinking this could be automated. Write something that reads all scheduled jobs and adds them and deletes the old records. Whatever you write would need to run from the Windows job scheduler because it wouldn't run at all in the spring if it ran from Quartz.

Related

Quartz.NET and Daylight Savings Time

I need help understanding how daylight savings time and daily standard time will affect our jobs.
The docs say that CRON schedules will run at the same time of day regardless of daylight savings time. "CronTrigger allows you to schedule jobs to fire at certain moments with respect to a "gregorian calendar". Hence, if you create a trigger to fire every day at 10:00 am, before and after daylight savings time switches it will continue to do so."
The docs don't mention how DST affects WithDailyTimeIntervalSchedule.
What I don't understand with either CRON or WithDailyTimeIntervalSchedule is: If I schedule a job to run at 10:00 AM UTC, which is 6:00 AM EST half of the year, but is 5:00 AM EST the other half, won't my schedule run at these different EST hours depending on whether we are in Daily Time versus Standard Time?
Or do we need to save them with the TimeZonedID that we want to run them in (like "Eastern Standard Time")?
I realize this isn't a quartz specific question. Just trying to get some help understanding this.
Thanks, Brent

Why TFS ServiceHooks delayed?

Why TFS ServiceHooks delayed in a few hours before it works.
In the history of the ServiceHooks it shows at Summary, sent at 11:13 while the response was at 09:13
Please check the web hooks sent time from history (reference below screenshot),
Take a look at the time setting(eg: China Standard time here) to check it’s the real delay but not due to Time zone difference.
If the delay happens consistently and each time delay hours, highly doubt it's a time zone difference, not a real delay. Please double check your server time zone and web site's.

How to create tasks to repeat at a certain time in swift

After some research I read in several places that Apple does not let applications run in backgroud except for some specific categories, but I need a solution and I could not find help in any documentation and / or research.
I have the need to leave an automatic task to occur at 10:45 pm which in the case would be to subtract the existing value in a variable to another variable, a discount calculation basically, however the user can choose which days of the week it will repeat itself , however the schedule it runs will always be at 10:45 pm, would anyone have a solution?

Quartz .NET - remove trigger if all future fire times in past

I've set up the quartz scheduler to ignore misfires and move on to the next fire time (using .WithMisfireHandlingInstructionNextWithRemainingCount() and .WithMisfireHandlingInstructionDoNothing()). This works fine but if there is no next fire time the trigger will just keep the old next fire time that has already misfired and wait for it to fire (it will never fire because it is in the past).
The way I'm testing this is pausing a trigger and waiting for the fire times to pass/misfire. The trigger's state is updated to COMPLETE only after resuming and remains in the database. I want the trigger to remove itself from the database (like it normally does when complete). I also want the trigger to complete without me having to resume the trigger but that's a bonus.
So the problem was I was setting the start time (using .StartAt() method) to the start time of the intervals I was using. For example, let's say it is currently 9am on June 23rd. If I had a trigger that runs daily starting at 3am then the start time of the daily interval is 3am. However, I was also setting the start time of the trigger to 3am, which is in the past. This ended up causing me many issues.

Auto-detect time of day

I'm writing a daily to do list app, and want the app to update certain elements with each new day. This isn't a problem if the user closes the app one day and then reopens it the next -- I just compare days in the startup methods.
However, this is a problem if the user happens to be using the app exactly at midnight. At midnight, daily task elements need to reset themselves automatically for the new day.
Here's my issue -- I could have a constant thread running in the background, always accessing [NSDate date] and checking for a new day. But I feel like there must be a better way, especially because this only has to happen once per day (and then, only if the user is using the app at midnight).
Thank you in advance!
In applicationDidFinishLaunching: and applicationWillEnterForeground:, setup an NSTimer scheduled to trigger at midnight. Also, register for UIApplicationSignificantTimeChangeNotification to reschedule the timer for time zone changes etc.

Resources