MDL-65050 core: rename task to question_preview_cleanup_task

This commit is contained in:
Simey Lameze
2019-04-01 12:57:01 +08:00
parent 0920f35ed9
commit 5a01c2409a
5 changed files with 24 additions and 6 deletions
+1 -1
View File
@@ -1243,7 +1243,7 @@ $string['taskpasswordresetcleanup'] = 'Cleanup password reset attempts';
$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';
@@ -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
@@ -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).
+1 -1
View File
@@ -213,7 +213,7 @@ $tasks = array(
'month' => '*'
),
array(
'classname' => 'core\task\question_cron_task',
'classname' => 'core\task\question_preview_cleanup_task',
'blocking' => 0,
'minute' => '*',
'hour' => '*',
+15
View File
@@ -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;
}
+1 -1
View File
@@ -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.