1
0
mirror of https://github.com/moodle/moodle.git synced 2025-03-15 05:00:06 +01:00

MDL-71899 performance: Improve course image caching

Changed to use get_course() instead of get_fast_modinfo() for better performance
This commit is contained in:
Huong Nguyen 2021-09-09 09:21:11 +07:00
parent 443a980aea
commit e0dd5f268a

@ -56,7 +56,8 @@ class course_image implements cache_data_source {
* @return string|bool Returns course image url as a string or false if the image is not exist
*/
public function load_for_cache($key) {
$course = get_fast_modinfo($key)->get_course();
// We should use get_course() instead of get_fast_modinfo() for better performance.
$course = get_course($key);
return $this->get_image_url_from_overview_files($course);
}