mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
MDL-49489 caching: Prevent full coursecontact purge
This commit is contained in:
parent
06122e46fd
commit
6a5681db1b
1 changed files with 2 additions and 1 deletions
|
@ -713,7 +713,8 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate {
|
|||
if (empty($cacheddata['basic']) || $cacheddata['basic']['roles'] !== $CFG->coursecontact ||
|
||||
$cacheddata['basic']['lastreset'] < time() - self::CACHE_COURSE_CONTACTS_TTL) {
|
||||
// Reset cache.
|
||||
$cache->purge();
|
||||
$keys = $DB->get_fieldset_select('course', 'id', '');
|
||||
$cache->delete_many($keys);
|
||||
$cache->set('basic', array('roles' => $CFG->coursecontact, 'lastreset' => time()));
|
||||
$cacheddata = $cache->get_many(array_merge(array('basic'), array_keys($courses)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue