When using a crontab like "5 * * * *" (which equals to 5 minutes after every full hour) then the first calculation of the next timestamp to execute is failing in most cases.
Lets say it's 17:09. The outer loop in JobSchedulerCronTab::nextHour() goes into the inner queue with hour=17 and the inner queue pulls the only item "5" from the minutes array.
So, the first step to correct this is to copy the minutes array into a working array so that the original array is again avaiable when getting into the inner queue next time.
But the second problem is that even for later hours, the current minute (=9) is always greater than the wanted value (=5) so we will not get any of the next hours on the current day.
Attached is a small patch that resolves both problems and I hope you will be committing this to the dev branch.
Comment | File | Size | Author |
---|---|---|---|
JobSchedulerCronTab.inc_.patch | 720 bytes | jurgenhaas | |
Comments
Comment #1
makara CreditAttribution: makara commentedPlease see #1137378: JobSchedulerCronTab->nextHour() doesn't work properly for specified minutes and please test the Git version.
Let us know if the errors are still there.
Comment #2
twistor CreditAttribution: twistor commentedClosing as a duplicate of #1137378: JobSchedulerCronTab->nextHour() doesn't work properly for specified minutes.