diff --git a/lang/en/admin.php b/lang/en/admin.php index 34ed615a5d354..d3f95c5494678 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -1243,7 +1243,7 @@ $string['taskplagiarismcron'] = 'Background processing for legacy cron in plagiarism plugins'; $string['taskportfoliocron'] = 'Background processing for portfolio plugins'; $string['taskprocessing'] = 'Task processing'; -$string['taskquestioncron'] = 'Background processing for question engine'; +$string['taskquestioncron'] = 'Background processing for cleaning up the old question previews'; $string['taskrefreshsystemtokens'] = 'Refresh OAuth tokens for service accounts'; $string['taskregistrationcron'] = 'Site registration'; $string['tasksendfailedloginnotifications'] = 'Send failed login notifications'; diff --git a/lib/classes/task/question_cron_task.php b/lib/classes/task/question_preview_cleanup_task.php similarity index 82% rename from lib/classes/task/question_cron_task.php rename to lib/classes/task/question_preview_cleanup_task.php index d7d9cc5063b10..fc0348d4e0ee0 100644 --- a/lib/classes/task/question_cron_task.php +++ b/lib/classes/task/question_preview_cleanup_task.php @@ -15,7 +15,7 @@ // along with Moodle. If not, see . /** - * A scheduled task. + * Task to cleanup old question previews. * * @package core * @copyright 2013 onwards Martin Dougiamas http://dougiamas.com @@ -24,9 +24,12 @@ namespace core\task; /** - * Simple task to run the question cron. + * A task to cleanup old question previews. + * + * @copyright 2013 onwards Martin Dougiamas http://dougiamas.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class question_cron_task extends scheduled_task { +class question_preview_cleanup_task extends scheduled_task { /** * Get a descriptive name for this task (shown to admins). diff --git a/lib/db/tasks.php b/lib/db/tasks.php index f78f36ad534ca..2350af2e66339 100644 --- a/lib/db/tasks.php +++ b/lib/db/tasks.php @@ -213,7 +213,7 @@ 'month' => '*' ), array( - 'classname' => 'core\task\question_cron_task', + 'classname' => 'core\task\question_preview_cleanup_task', 'blocking' => 0, 'minute' => '*', 'hour' => '*', diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 7d28a63155100..a39d9ac74a9e4 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2923,5 +2923,20 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2019032200.02); } + if ($oldversion < 2019032800.01) { + $sql = "UPDATE {task_scheduled} + SET classname = ? + WHERE component = ? + AND classname = ?"; + $DB->execute($sql, [ + '\core\task\question_preview_cleanup_task', + 'moodle', + '\core\task\question_cron_task' + ]); + + // Main savepoint reached. + upgrade_main_savepoint(true, 2019032800.01); + } + return true; } diff --git a/version.php b/version.php index eeaaa852057cd..ef8f006518434 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2019032800.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2019032800.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.