Skip to content

Commit

Permalink
MDL-33884 question export: raise memory limit
Browse files Browse the repository at this point in the history
Question exports can be quite big, just like imports can. Therefore, we
should raise memory limits in the same way.

(Of course, eventually we should change the API, so that it writes one
questoin at a time, rather than building the whole export file contents
in RAM first, but that would be a much bigger change, and we need a
quick fix now.)
  • Loading branch information
timhunt committed Jul 31, 2019
1 parent 1a89704 commit 0101cef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions question/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,10 @@ protected function presave_process($content) {
public function exportprocess($checkcapabilities = true) {
global $CFG, $DB;

// Raise time and memory, as exporting can be quite intensive.
core_php_time_limit::raise();
raise_memory_limit(MEMORY_EXTRA);

// Get the parents (from database) for this category.
$parents = [];
if ($this->category) {
Expand Down

0 comments on commit 0101cef

Please sign in to comment.