Skip to content

Commit

Permalink
MDL-69106 assignfeedback_editpdf: Keep files in conversion queue
Browse files Browse the repository at this point in the history
In some circumstances, a submission waiting to be converted needs to persist
in the conversion queue so that it can be polled on subsequent cron runs.
  • Loading branch information
cameorn1730 committed Jun 30, 2020
1 parent c11e251 commit 548c44c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function execute() {
}

mtrace('Convert ' . count($users) . ' submission attempt(s) for assignment ' . $assignmentid);
$conversionrequirespolling = false;

foreach ($users as $userid) {
try {
Expand All @@ -107,6 +108,7 @@ public function execute() {
case combined_document::STATUS_READY_PARTIAL:
case combined_document::STATUS_PENDING_INPUT:
// The document has not been converted yet or is somehow still ready.
$conversionrequirespolling = true;
continue 2;
}
document_services::get_page_images_for_attempt(
Expand All @@ -127,7 +129,9 @@ public function execute() {
}

// Remove from queue.
$DB->delete_records('assignfeedback_editpdf_queue', array('id' => $record->id));
if (!$conversionrequirespolling) {
$DB->delete_records('assignfeedback_editpdf_queue', array('id' => $record->id));
}

}
}
Expand Down

0 comments on commit 548c44c

Please sign in to comment.