mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 13:33:52 +02:00
MDL-72135 auth_mnet: Remove rand() from mnet cron task
This commit is contained in:
parent
036800d99d
commit
bdba9f695d
@ -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]);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ $tasks = array(
|
||||
array(
|
||||
'classname' => '\auth_mnet\task\cron_task',
|
||||
'blocking' => 0,
|
||||
'minute' => '*',
|
||||
'minute' => '*/10',
|
||||
'hour' => '*',
|
||||
'day' => '*',
|
||||
'month' => '*',
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user