MDL-47221 task: allow 'random' time definitions
authorDan Poltawski <dan@moodle.com>
Sat, 27 Sep 2014 20:22:57 +0000 (21:22 +0100)
committerDan Poltawski <dan@moodle.com>
Sun, 5 Oct 2014 13:27:04 +0000 (14:27 +0100)
commit16078807f8b9ee4e7691fdc24a5a61adb8d07b38
treed024a370fb61647fc62b2e7fa413b56305bd6453
parent6597413d41fd3f47d078baa2152f0219f8a463f8
MDL-47221 task: allow 'random' time definitions

When working against external services it can be advantageous to not
have automated tasks all hit the service at the exact same time from
many different installations.

This change allows the use of 'R' in hour/minute fields of the scheduled
task definition so a task will be installed with a 'random' hour/minute
value for these sort of occasions.

Note that the task will be installed in the database with a defined
time, this simply randomises the time chosen when loading from the
definiton.
lib/classes/task/scheduled_task.php
lib/tests/scheduled_task_test.php
lib/upgrade.txt