When processing each batch export.php will throw a fatal timeout error if processing the batch takes too long.
The offending code is lines 62-80:
foreach ($batches as $count => $batch) {
set_time_limit($_GET['max_execution_time_per_batch']);
try {
$records = REDCap::getData('csv', $batch);
// Trim the header on all but the first row of the first batch.
if ($count) {
$first_lb = strpos($records, "\n");
if ($first_lb !== false) {
$records = substr($records, $first_lb + 1);
}
}
fwrite($fh, $records);
}
catch (Exception $e) {
$module->callJsCallback('displayErrorMsg');
}
The set_time_limit method throws the fatal error. This type of error cannot by caught by try, catch blocks.
To recreate this issue insert a while(true) statement inside the foreach loop and set the max execution time (which is configured in the module's settings) to something small like 2 seconds.
When processing each batch
export.php
will throw a fatal timeout error if processing the batch takes too long.The offending code is lines 62-80:
The
set_time_limit
method throws the fatal error. This type of error cannot by caught by try, catch blocks.To recreate this issue insert a
while(true)
statement inside theforeach
loop and set the max execution time (which is configured in the module's settings) to something small like 2 seconds.