Commit 1dbbbd9f authored by Robert Lyon's avatar Robert Lyon

Bug 1785985: Offset the problematic cron jobs

As mentioned in forum post
https://mahara.org/interaction/forum/topic.php?id=8450#post33705

behatnotneeded

Change-Id: I700c295d6d4ced232a119c3f8dbbc922a73298d3
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 1d74f6ec
......@@ -427,7 +427,7 @@ EOF;
return array(
(object)array(
'callfunction' => 'interaction_forum_new_post',
'minute' => '*/30',
'minute' => '3-59/30',
),
(object)array(
'callfunction' => 'clean_forum_notifications',
......
......@@ -1347,5 +1347,12 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if ($oldversion < 2019051600) {
log_debug('offset some troublesome cron jobs');
execute_sql("UPDATE {cron} SET minute = ? WHERE callfunction = ?", array('2-59/5', 'user_login_tries_to_zero'));
execute_sql("UPDATE {interaction_cron} SET minute = ? WHERE plugin = ? AND callfunction = ?", array('3-59/30', 'forum', 'interaction_forum_new_post'));
execute_sql("UPDATE {search_cron} SET minute = ? WHERE plugin = ? AND callfunction = ?", array('4-59/5', 'elasticsearch', 'cron'));
}
return $status;
}
......@@ -1041,7 +1041,7 @@ function core_install_firstcoredata_defaults() {
'cron_clean_internal_activity_notifications'=> array(45, 22, '*', '*', '*'),
'cron_sitemap_daily' => array(0, 1, '*', '*', '*'),
'file_cleanup_old_cached_files' => array(0, 1, '*', '*', '*'),
'user_login_tries_to_zero' => array('*/5', '*', '*', '*', '*'),
'user_login_tries_to_zero' => array('2-59/5', '*', '*', '*', '*'),
'cron_institution_registration_data' => array(rand(0, 59), rand(0, 23), '*', '*', rand(0, 6)),
'cron_institution_data_weekly' => array('55', '23', '*', '*', '6'),
'cron_institution_data_daily' => array('51', '23', '*', '*', '*'),
......
......@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2019051300;
$config->version = 2019051600;
$config->series = '19.10';
$config->release = '19.10dev';
$config->minupgradefrom = 2017031605;
......
......@@ -655,7 +655,7 @@ class PluginSearchElasticsearch extends PluginSearch {
(object)array(
'callfunction' => 'cron',
'hour' => '*',
'minute' => '*/5',
'minute' => '4-59/5',
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment