mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-64884 auth_mnet: deprecate legacy cron() method
This commit is contained in:
parent
e425221ee6
commit
942cc5b1da
@ -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
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user