MDL-64884 auth_mnet: deprecate legacy cron() method

This commit is contained in:
Simey Lameze 2019-02-20 13:48:56 +08:00
parent e425221ee6
commit 942cc5b1da

View File

@ -737,25 +737,6 @@ class auth_plugin_mnet extends auth_plugin_base {
return array('code' => 1, 'message' => $returnString, 'last log id' => $remoteclient->last_log_id);
}
/**
* Cron function will be called automatically by cron.php every 5 minutes
*
* @return void
*/
function cron() {
global $DB;
// run the keepalive client
$this->keepalive_client();
$random100 = rand(0,100);
if ($random100 < 10) { // Approximately 10% of the time.
// nuke olden sessions
$longtime = time() - (1 * 3600 * 24);
$DB->delete_records_select('mnet_session', "expires < ?", array($longtime));
}
}
/**
* Cleanup any remote mnet_sessions, kill the local mnet_session data
*