MDL-55987 gradebook: Claim extra memory when updating final grades

As we experienced in a bigger moodle.org course (7500 users, 70 grade
items), the standard memory limit 256M may not be enough here. We were
not able to find any obvious memory leak in the processing. Requiring
extra memory helped in this particular case and it seems reasonable to
have it in the core.
This commit is contained in:
David Mudrák 2016-09-16 12:35:07 +02:00
parent 1f2744851f
commit d676f6bd19

View File

@ -1115,8 +1115,9 @@ function grade_recover_history_grades($userid, $courseid) {
* @return bool true if ok, array of errors if problems found. Grade item id => error message
*/
function grade_regrade_final_grades($courseid, $userid=null, $updated_item=null, $progress=null) {
// This may take a very long time.
// This may take a very long time and extra memory.
\core_php_time_limit::raise();
raise_memory_limit(MEMORY_EXTRA);
$course_item = grade_item::fetch_course_item($courseid);