-
Bug
-
Resolution: Fixed
-
Minor
-
3.9.3, 3.10, 3.11, 4.0
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
-
MOODLE_310_STABLE, MOODLE_39_STABLE
-
master_
MDL-70520 -
Upgrade script resets scheduled tasks.
As part of this reset `nextruntime` is kept, but `lastruntime` is being set to 0.
This can lead to some issues. For example `\mod_assign\task\cron_task` task checks its last time run https://github.com/moodle/moodle/blob/4ec279a2f063ae890804126e4886f87fe83b5cea/mod/assign/locallib.php#L2521 and then selects records to be processed based on returned value: https://github.com/moodle/moodle/blob/4ec279a2f063ae890804126e4886f87fe83b5cea/mod/assign/locallib.php#L2696-L2697 so when lastruntime equals 0, the task gets all records including those ones which were already processed as part of previous runs.