Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'MDL-63234-master' of git://github.com/andrewnicols/moodle
  • Loading branch information
David Monllao committed Aug 27, 2018
2 parents 12f7678 + 1a5a0b9 commit 39d5bf0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions blocks/recent_activity/classes/task/cleanup.php
Expand Up @@ -50,9 +50,12 @@ public function get_name() {
* Remove old entries from table block_recent_activity
*/
public function execute() {
global $DB;
global $CFG, $DB;
require_once("{$CFG->dirroot}/course/lib.php");

// Those entries will never be displayed as RECENT anyway.
$DB->delete_records_select('block_recent_activity', 'timecreated < ?',
array(time() - COURSE_MAX_RECENT_PERIOD));
$DB->delete_records_select('block_recent_activity', 'timecreated < ?', [
time() - COURSE_MAX_RECENT_PERIOD,
]);
}
}

0 comments on commit 39d5bf0

Please sign in to comment.