mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
ef964137ce
When bulk-updating course module visibility, set_coursemodule_visibily was triggering a partial cache purge and rebuild for each course module. This potentially led to 2 cache sets each requiring a lock to be acquired and released per course module, plus any other cache updates for other changes to the course in the same request. This adds a new $rebuildcache paramter to the set_coursemodule_visibilty, which is true by default to retain the existing behaviour. If set false, it will skip doing the partial purge and rebuild for that course module, and it is up to the calling code to ensure the cache is updated as requried. To assist with this, there is a new course_modinfo::purge_course_module_cache_multiple() method, which allows multiple course modules to be purged from the cache in a single cache set.