From 6a5681db1bfbaf30ee56f87503ea2207eb2dbda9 Mon Sep 17 00:00:00 2001 From: Skylar Kelty Date: Mon, 16 Mar 2015 09:22:53 +0000 Subject: [PATCH] MDL-49489 caching: Prevent full coursecontact purge --- lib/coursecatlib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/coursecatlib.php b/lib/coursecatlib.php index a027c557cb8..7dad744d63a 100644 --- a/lib/coursecatlib.php +++ b/lib/coursecatlib.php @@ -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))); } -- 2.36.1