diff --git a/auth/mnet/classes/task/cron_task.php b/auth/mnet/classes/task/cron_task.php index dbd8e177dbc..a7bc684cd77 100644 --- a/auth/mnet/classes/task/cron_task.php +++ b/auth/mnet/classes/task/cron_task.php @@ -42,11 +42,6 @@ class cron_task extends \core\task\scheduled_task { require_once($CFG->dirroot . '/auth/mnet/auth.php'); $mnetplugin = new \auth_plugin_mnet(); $mnetplugin->keepalive_client(); - - $random100 = rand(0,100); - if ($random100 < 10) { - $longtime = time() - DAYSECS; - $DB->delete_records_select('mnet_session', "expires < ?", [$longtime]); - } + $DB->delete_records_select('mnet_session', "expires < ?", [time() - DAYSECS]); } } diff --git a/auth/mnet/db/tasks.php b/auth/mnet/db/tasks.php index e85dc3d6619..37722c085dd 100644 --- a/auth/mnet/db/tasks.php +++ b/auth/mnet/db/tasks.php @@ -25,7 +25,7 @@ $tasks = array( array( 'classname' => '\auth_mnet\task\cron_task', 'blocking' => 0, - 'minute' => '*', + 'minute' => '*/10', 'hour' => '*', 'day' => '*', 'month' => '*', diff --git a/auth/mnet/version.php b/auth/mnet/version.php index b7fdadaa0a8..41884e9dd03 100644 --- a/auth/mnet/version.php +++ b/auth/mnet/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2021071200; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2021052500; // Requires this Moodle version. $plugin->component = 'auth_mnet'; // Full name of the plugin (used for diagnostics)