Closed (fixed)
Project:
Elysia Cron
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
2 Jul 2012 at 12:57 UTC
Updated:
25 Jul 2012 at 07:41 UTC
Jump to comment: Most recent file
When using day of the week in the cron rule you can get an incorrect timestamp for when the cronjob will run next.
Repoduce bug:
// Let elysia cron determine the next time our rule will run. Note that last run contains the timestamp for 26.06.2012 5:00:00.
$next_run = _elysia_cron_next_run(array('rule' => '0 5 * * 2', 'last_run' => 1340686800));
// This will output "02.07.2012 5:00:00" instead of "03.07.2012 5:00:00".
echo date('d.m.Y H:i:s', $next_run);
This issue only happens during a month transition where the number of days in the month is less then 31.
The following fix solves this issue (will create patch soon...):
// elysia_cron_scheduler.inc:142 -> change $range_to to 31.
$r1['n'] = array_merge($r1['n'], __cronMonDaysFromWeekDays($year, $month, $r2['n']), __cronMonDaysFromWeekDays($year, $month + 1, $r2['n'], 31));
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | elysia_cron-day_of_the_week_incorrect_during_month_transition-1668302-2.patch | 2.03 KB | freblasty |
Comments
Comment #1
m.mahner commentedSame issue with the 7.x-2.x branch.
I'm not sure about how to handle this - should I open another issue on the 7.x-2.x tracker? Or just set the version of this issue to none?
Comment #2
freblasty commentedCreated patch for the 6.x-2.x branch.
Comment #3
gotheric commentedThank your for the issue and patch.
I've commited it in last DEV release (it will go in STABLE branch in about month, i think).
WARNING ABOUT NEW DEV VERSION:
This has a lot of refactoring in internal APIs and should NOT be used in production sites (or do that at your own risk). I've tested it a little, but it's under construction yet so i don't assure every use case works.
It's only for D7 (i'll sync the D6 version only at the end of the development of the D7 one)
Changes:
- A lot of internal API improvements
- Completely rewritten Drush support, with a lot of features (and several to come). Now "drush cron" (or "drush core-cron") works as expected, and has several options.
See "drush help elysia-cron" for them.
- Better support for Drupal queues
- More to come (i think this will become a "2.5" version)
Comment #4
freblasty commentedTo which branch has the patch been commited?
Comment #5
gotheric commentedYou can find it in "Development releases", but Drupal build system rebuild it only once a day, so you should wait that release date will update.
(Or you can checkout from GIT, if you're really in need)