-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leap year scheduling problem #329
Comments
That's interesting, so far no luck in reproducing it. I tried scheduling something at 8:38am on 17/5 (today) with I also tried scheduling something at 8:41am on Friday (today) with What does SELECT now() return? |
I set the timestamp to Europe/Rome. |
I am having the same issue. I have a bunch of jobs that I scheduled on Mondays, but they are running on Sundays since March 2024 (which supports the assumption that this is caused by the leap year). This is what I get from
You can see here that the Monday jobs ran fine in February (5th, 12th , 19th and 26th are all Mondays) and they started running on Sunday since March 3rd. I am running postgres on Google Cloud using Cloud SQL, with the maintenance version SELECT NOW(); gives me the correct time: Moreover you can see in the |
I am having the same issue, and I found that pg_cron doesn't recognize leap years, and the bug inited after February 28. The same happens with weekdays, and for today (Friday), I have to schedule it for tomorrow (Saturday). Initially, the problem occurred on the PG12 cluster, but further tests shown the same error on AWS RDS pg15. |
For my project we use Postgres 12 and the pg_cron extension at version 1.6.
During the testing phase we realized that the scheduling for the days of the week does not work correctly and the cause is linked to the current year which is a leap year.
Scheduling these jobs:
job 22 refers to the schedule with day of the week 5 (Friday) while the job with id 21 refers to a schedule with day of the week 4 (Thursday) or (Today 16/05/2024).
We noticed that job 21 was not executed while job 22 was executed. We expected the opposite. This made me think that one cause could be pg_cron's handling of leap years. I think it's all there.
Below is the extraction of the
cron.job_run_details:
I hope it can help solve the problem.
Best regards
Marco
The text was updated successfully, but these errors were encountered: