Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.9.3, 3.10, 3.11, 4.0
-
Component/s: Administration, Tasks
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
-
Fixed Branches:MOODLE_310_STABLE, MOODLE_39_STABLE
-
Pull from Repository:
-
Pull 3.9 Branch:MOODLE_39_
MDL-70520 -
Pull 3.10 Branch:MOODLE_310_
MDL-70520 -
Pull 3.11 Branch:MOODLE_311_
MDL-70520 -
Pull Master Branch:master_
MDL-70520 -
Pull Master Diff URL:
Description
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.