diff --git a/mod/chat/lib.php b/mod/chat/lib.php index 0db27f2be45..bd787088f46 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -399,41 +399,6 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) { return true; } -/** - * Function to be run periodically according to the moodle cron - * This function searches for things that need to be done, such - * as sending out mail, toggling flags etc ... - * - * @global object - * @return bool - */ -function chat_cron () { - global $DB; - - chat_update_chat_times(); - - chat_delete_old_users(); - - // Delete old messages with a single SQL query. - $subselect = "SELECT c.keepdays - FROM {chat} c - WHERE c.id = {chat_messages}.chatid"; - - $sql = "DELETE - FROM {chat_messages} - WHERE ($subselect) > 0 AND timestamp < ( ".time()." -($subselect) * 24 * 3600)"; - - $DB->execute($sql); - - $sql = "DELETE - FROM {chat_messages_current} - WHERE timestamp < ( ".time()." - 8 * 3600)"; - - $DB->execute($sql); - - return true; -} - /** * This standard function will check all instances of this module * and make sure there are up-to-date events created for each of them. diff --git a/mod/chat/version.php b/mod/chat/version.php index 58f76662db7..3655682bd81 100644 --- a/mod/chat/version.php +++ b/mod/chat/version.php @@ -27,4 +27,3 @@ defined('MOODLE_INTERNAL') || die(); $plugin->version = 2018120301; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2018112800; // Requires this Moodle version. $plugin->component = 'mod_chat'; // Full name of the plugin (used for diagnostics). -$plugin->cron = 300;