Skip to content

Commit

Permalink
fixes for pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin McFadden committed Jul 15, 2024
1 parent d07d254 commit 05f706c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions application/controllers/Beltdrive.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ public function processAWSBatchJob($fileObjectId) {
}
// reload each time to make sure artifacts get properly populated
$fileHandler->loadByObjectId($fileObjectId);
// lookup instance based on this file's collection.
$collection = $this->collection_model->getCollection($fileHandler->collectionId);
if($collection) {
$instances = $collection->getInstances();
if(count($instances) > 0) {
$instance = $instances[0];
$instanceId = $instance->getId();
$this->instance = $instance;
}
}
$performTaskByName = $fileHandler->performTaskByName($task["taskType"], array_merge($task["config"], ["runInLoop"=>true]));
if($performTaskByName == JOB_FAILED) {
// do some logging?
Expand Down
9 changes: 7 additions & 2 deletions application/libraries/PDFHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public function minifyPDF($pdfFile) {
$process->run();
while($process->isRunning()) {
sleep(5);
$this->CI->pheanstalk->touch($this->CI->job);
if(isset($this->CI->job)) {
$this->CI->pheanstalk->touch($this->CI->job);
}
echo ".";
}
if(!file_exists($outFile)) {
Expand Down Expand Up @@ -61,7 +63,10 @@ public function scrapeText($pdfFile) {
$process->run();
while($process->isRunning()) {
sleep(5);
$this->CI->pheanstalk->touch($this->CI->job);
if(isset($this->CI->job)) {
$this->CI->pheanstalk->touch($this->CI->job);
}

echo ".";
}

Expand Down
3 changes: 3 additions & 0 deletions application/models/filehandlers/Pdfhandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ public function createThumbnails($args) {
ini_set('memory_limit', '4096M');
$success = true;
foreach($args as $derivativeSetting) {
if(!isset($derivativeSetting['type'])) {
continue;
}
$derivativeType = $derivativeSetting['type'];
$width = $derivativeSetting['width'];
$height = $derivativeSetting['height'];
Expand Down

0 comments on commit 05f706c

Please sign in to comment.