Commit 4c620d4d authored by Robert Lyon's avatar Robert Lyon
Browse files

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: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 1fd6e938
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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',
+7 −0
Original line number Diff line number Diff line
@@ -1324,5 +1324,12 @@ function xmldb_core_upgrade($oldversion=0) {
        }
    }

    if ($oldversion < 2019031908) {
        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;
}
+1 −1
Original line number Diff line number Diff line
@@ -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', '*', '*', '*'),
+1 −1
Original line number Diff line number Diff line
@@ -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 = 2019031907;
$config->version = 2019031908;
$config->series = '19.04';
$config->release = '19.04.1testing';
$config->minupgradefrom = 2017031605;
+1 −1
Original line number Diff line number Diff line
@@ -655,7 +655,7 @@ class PluginSearchElasticsearch extends PluginSearch {
            (object)array(
                'callfunction' => 'cron',
                'hour'         => '*',
                'minute'       => '*/5',
                'minute'       => '4-59/5',
            ),
        );
    }