MDL-79186 task: fix evaluation of 'X/Y' cron field format.
The above syntax is defined as supported by the class, for example the format '5/10' means: "At every 10th <unit> from 5 through <max>." It is analogous to '5-<max>/10'.
This commit is contained in:
@@ -384,6 +384,11 @@ abstract class scheduled_task extends task_base {
|
||||
return [];
|
||||
}
|
||||
if ($instep) {
|
||||
// Normalise range property, account for "5/10".
|
||||
$insteprange = $range[count($range) - 1];
|
||||
if (!is_array($insteprange)) {
|
||||
$range[count($range) - 1] = range($insteprange, $max);
|
||||
}
|
||||
for ($i = 0; $i < count($range[count($range) - 1]); $i++) {
|
||||
if (($i) % $match != 0) {
|
||||
$range[count($range) - 1][$i] = -1;
|
||||
|
||||
Reference in New Issue
Block a user