Skip to content

Commit

Permalink
MDL-65050 core: rename task to question_preview_cleanup_task
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed Apr 1, 2019
1 parent 0920f35 commit 5a01c24
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lang/en/admin.php
Expand Up @@ -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';
Expand Down
Expand Up @@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* A scheduled task.
* Task to cleanup old question previews.
*
* @package core
* @copyright 2013 onwards Martin Dougiamas http://dougiamas.com
Expand All @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion lib/db/tasks.php
Expand Up @@ -213,7 +213,7 @@
'month' => '*'
),
array(
'classname' => 'core\task\question_cron_task',
'classname' => 'core\task\question_preview_cleanup_task',
'blocking' => 0,
'minute' => '*',
'hour' => '*',
Expand Down
15 changes: 15 additions & 0 deletions lib/db/upgrade.php
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -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.

Expand Down

0 comments on commit 5a01c24

Please sign in to comment.