MDL-67274 Tasks: Log display fails with memory errors
authorsam marshall <s.marshall@open.ac.uk>
Fri, 15 Nov 2019 13:55:43 +0000 (13:55 +0000)
committersam marshall <s.marshall@open.ac.uk>
Mon, 18 Nov 2019 13:46:32 +0000 (13:46 +0000)
admin/classes/task_log_table.php
admin/tasklogs.php

index 2bb892d..949e757 100644 (file)
@@ -131,7 +131,8 @@ class task_log_table extends \table_sql {
         }
 
         $sql = "SELECT
-                    tl.*,
+                    tl.id, tl.type, tl.component, tl.classname, tl.userid, tl.timestart, tl.timeend,
+                    tl.dbreads, tl.dbwrites, tl.result,
                     tl.dbreads + tl.dbwrites AS db,
                     tl.timeend - tl.timestart AS duration,
                     {$userfields}
index 7820f60..0fb5206 100644 (file)
@@ -46,6 +46,8 @@ $logid = optional_param('logid', null, PARAM_INT);
 $download = optional_param('download', false, PARAM_BOOL);
 
 if (null !== $logid) {
+    // Raise memory limit in case the log is large.
+    raise_memory_limit(MEMORY_HUGE);
     $log = $DB->get_record('task_log', ['id' => $logid], '*', MUST_EXIST);
 
     if ($download) {