When a corrupt file is added to the queue, the cron will try to convert it, instead of skipping it and adding a FAILED state, it will throw an exception and end the script, so the next time the cron is run, it will try to convert the same file again and is basically caught in a loop.
Suggestion: Instead fo throwing an exception, set the status to "conversion::STATUS_FAILED" so the file is not attempted again, and return it so the queue will continue with the next file.
if (!isset($json['result']['pdf']) || is_null($json)) {
// throw new coding_exception('Response was: '.$response);
$conversion->set('status', conversion::STATUS_FAILED);
$conversion->update();
mtrace($response);
return $this;
}
When a corrupt file is added to the queue, the cron will try to convert it, instead of skipping it and adding a FAILED state, it will throw an exception and end the script, so the next time the cron is run, it will try to convert the same file again and is basically caught in a loop.
Suggestion: Instead fo throwing an exception, set the status to "conversion::STATUS_FAILED" so the file is not attempted again, and return it so the queue will continue with the next file.