MDL-62214 tool_messageinbound: Delete old messages pending verification
This commit is contained in:
@@ -310,6 +310,16 @@ class manager {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove older verification failures.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tidy_old_verification_failures() {
|
||||
global $DB;
|
||||
$DB->delete_records_select('messageinbound_messagelist', 'timecreated < :time', ['time' => time() - DAYSECS]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a message and pass it through the Inbound Message handling systems.
|
||||
*
|
||||
|
||||
@@ -49,6 +49,7 @@ class cleanup_task extends \core\task\scheduled_task {
|
||||
*/
|
||||
public function execute() {
|
||||
$manager = new \tool_messageinbound\manager();
|
||||
return $manager->tidy_old_messages();
|
||||
$manager->tidy_old_messages();
|
||||
$manager->tidy_old_verification_failures();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user