You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a job scheduled to take place at midnight every day, I use the background scheduler and crontrigger with hour and minute set to zero, timezone set to 'US/Pacific', jitter set to 10.
Its worked flawlessly until yesterday. Changes due to daylight savings take place between 2AM and 3AM, so scheduling at midnight shouldnt create any issues according to the docs.
2022-03-13 00:00:07,641 - 2152 - INFO - Running job "NewDay (trigger: cron[hour='0', minute='0'], next run at: 2022-03-15 00:00:06 PDT)" (scheduled at 2022-03-13 00:00:07.580111-08:00)
2022-03-13 00:00:07,641 - 2152 - INFO - Syncing To Excel DB On Sun Mar 13 00:00:07 2022
2022-03-13 00:00:07,908 - 2152 - INFO - Job "NewDay (trigger: cron[hour='0', minute='0'], next run at: 2022-03-15 00:00:06 PDT)" executed successfully
As you can see, 'next run' is scheduled to run at midnight two days after the last job has run, it skips March 14 entirely.
This is being run on a Windows 10 system in southern California.
Please advise how to remedy - thank you.
(Please be mindful that while I am an older engineer, I am a novice python programmer. If I have missed something glaringly obvious, or posted this to the wrong place, my apologies in advance.)
The text was updated successfully, but these errors were encountered:
I added some debugging code which pointed me to the problem:
no valid value found for minute
next date: 2022-03-13 01:00:00-08:00
no valid value found for hour
next date: 2022-03-14 01:00:00-07:00
So where it should reset the lower order fields when incrementing the day of month, it somehow retains the hour as 1, therefore skipping the correct next fire time, 00:00:00.
I have a job scheduled to take place at midnight every day, I use the background scheduler and crontrigger with hour and minute set to zero, timezone set to 'US/Pacific', jitter set to 10.
Its worked flawlessly until yesterday. Changes due to daylight savings take place between 2AM and 3AM, so scheduling at midnight shouldnt create any issues according to the docs.
Heres the generating code:
sched = BackgroundScheduler()
sched.add_job(NewDay, CronTrigger(hour=0, minute=0, timezone='US/Pacific', jitter=10))
sched.start()
Heres the apscheduler log:
2022-03-13 00:00:07,641 - 2152 - INFO - Running job "NewDay (trigger: cron[hour='0', minute='0'], next run at: 2022-03-15 00:00:06 PDT)" (scheduled at 2022-03-13 00:00:07.580111-08:00)
2022-03-13 00:00:07,641 - 2152 - INFO - Syncing To Excel DB On Sun Mar 13 00:00:07 2022
2022-03-13 00:00:07,908 - 2152 - INFO - Job "NewDay (trigger: cron[hour='0', minute='0'], next run at: 2022-03-15 00:00:06 PDT)" executed successfully
As you can see, 'next run' is scheduled to run at midnight two days after the last job has run, it skips March 14 entirely.
This is being run on a Windows 10 system in southern California.
Please advise how to remedy - thank you.
(Please be mindful that while I am an older engineer, I am a novice python programmer. If I have missed something glaringly obvious, or posted this to the wrong place, my apologies in advance.)
The text was updated successfully, but these errors were encountered: