Scheduled Job ran twice after DST change

I don’t know why this would happen over 24 hours after the DST change (which occurred Sunday morning in Australia), but a script that I have scheduled to run at 7am each weekday actually ran twice this morning - once at 6am and then again at 7am:

The schedule is defined thusly:

New-PSUSchedule -Cron "0 7 * * 1-5" -Script "Send-TeamsLeavePost.ps1" -TimeZone "Australia/Sydney" -Credential "Default" -Name "Teams Leave Post" -Timeout 1 

It’s almost like PSU didn’t “realise” that DST had ended until it had run the script once at 6am, and then ran it again at the correct time an hour later.

I know firsthand how difficult time zones and DST can be, but you’d think Hangfire would have this staff figured out. Any thoughts?

Product: PowerShell Universal
Version: 2.0.9

I really would have thought that about hangfire as well. If you’re still in this state, can you check the hangfire dashboard to see if there are duplicates scheduled?

Just the single job (#1) scheduled for this one.

But it hasn’t happened since Monday morning. The first time the job had run after the DST changeover. It’s like it didn’t “notice” that DST had ended until it had run the job once at 6am, and then ran it again at 7am. It has run just at 7am since then. Very odd.

That is odd and something I might bring up with the Hangfire team to see if there is something we can do to resolve it.

1 Like

My scripts are generally idempotent so it’s not the end of the world, but this one in particular posts a “who’s on leave today” message to Teams, so the duplicate raised a few questions from end users. Typically nobody would even notice if a script ran twice. Again, no big deal, but worth asking the question.

Cool. Glad it wasn’t too impactful. I would like the job scheduler to be as deterministic as possible so I’ll still open an issue to do some research.

1 Like

For what it’s worth, this occurred in our PSU instance as well (v2.8.0) when DST hit in the US (March 13). It stopped running duplicate jobs once we recycled the IIS AppPool in Windows.

2 Likes