MDL-72135 auth_mnet: Remove rand() from mnet cron task

This commit is contained in:
Mikhail Golenkov
2021-08-14 10:54:00 +10:00
parent 036800d99d
commit bdba9f695d
3 changed files with 3 additions and 8 deletions
+1 -6
View File
@@ -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]);
}
}