MDL-55231 core_course: Partial course cache rebuild

This commit is contained in:
Dongsheng Cai 2021-07-16 13:49:35 +10:00
parent e5894c0455
commit 9a900492bc
15 changed files with 406 additions and 177 deletions

View file

@ -292,14 +292,15 @@ class condition extends \core_availability\condition {
$updatesection->availability = json_encode($tree->save());
$updatesection->timemodified = time();
$DB->update_record('course_sections', $updatesection);
course_purge_section_cache($section);
$anychanged = true;
}
}
// Ensure course cache is cleared if required.
if ($anychanged) {
rebuild_course_cache($courseid, true);
// Partial rebuild the sections which have been invalidated.
rebuild_course_cache($courseid, true, true);
}
}
}