Closed tuomassalo closed 8 years ago
In some cases, this even happens for $total == 3
:
$cron=Cron\CronExpression::factory("0 0 12 * * 2014");
$cron->getMultipleRunDates(3, "2014-11-04 00:00:00");'
Just ran into the same problem. Is there any workaround?
Okay. Probably not the best solutions but should be enough for a workaround:
$rd = null;
$rds = array();
for ($i = 0; $i < 50; $i++) {
$rd = $cron->getNextRunDate($rd);
$rds[] = $rd;
}
After this $rds is an array which contains the next 50 run dates.
@webpunk Your workaround is exactly the getMultipleRunDates method did, and it fails, too.
One could increase the brute-force hard limit to workaround this Exception
, just go ahead and increase 1000
to any bigger value you would like in src/Cron/CronExpression.php.
Can you re-test this with v1.1.0? I just tested locally and this seems to have cleared up this issue.
Closing since 1.1.0 seems to have cleared this up, and haven't heard anything back.
This works:
This fails:
with error:
The same error happens with different values of
$total
depending on the cron expression.