Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.7.3
-
MOODLE_27_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MDL-48442-master -
-
Team B Sprint 1
Description
When looking through the Task API, I noticed a potential problem: when tasks are added to the system or when the component has a version bump, then the task is scheduled to run ASAP. This means tasks that have very specific schedules would run at a random time for the first run and then subsequent runs would run according to the schedule. This could be bad if say, the point of the task was to send an email at midnight (according to its schedule), but the first run after install or every upgrade would send the email at a random time. To fix this, just calculate the next run time instead of using 0.