Browse Source

Fix issues

hidden_tags_with_bookmarks
Orzu Ionut 3 years ago
parent
commit
c07ee2aef0
  1. 3
      README.md
  2. 6
      app/Ingest/Convertor.php
  3. 4
      app/Jobs/IngestDocuments.php
  4. 4
      app/Jobs/SendToCore.php

3
README.md

@ -51,6 +51,9 @@ php artisan migrate
php artisan queue:deploy-supervisor
supervisorctl start all
# PDF Convertor
apt-get install poppler-utils
# Tesseract OCR
add-apt-repository ppa:alex-p/tesseract-ocr-devel
apt-get update

6
app/Ingest/Convertor.php

@ -203,11 +203,17 @@ class Convertor
}
}
\Illuminate\Support\Facades\Log::info('============================');
\Illuminate\Support\Facades\Log::info($this->path);
// We are done with the images processing, delete directory.
$this->storage->deleteDirectory($this->path);
$this->path = "$this->path.md";
\Illuminate\Support\Facades\Log::info($this->path);
\Illuminate\Support\Facades\Log::info('++++++++++++++++++++++++++');
$this->storage->put($this->path, $imagesContent);
}

4
app/Jobs/IngestDocuments.php

@ -78,7 +78,11 @@ class IngestDocuments implements ShouldQueue
try {
$this->path = $convertor->execute();
} catch (\Exception $exception) {
\Illuminate\Support\Facades\Log::info($exception->getMessage());
$this->failed();
return;
}
// @TODO Replace later, the convertor will create the .md file.

4
app/Jobs/SendToCore.php

@ -73,6 +73,10 @@ class SendToCore implements ShouldQueue
// if ($this->filePath && $sent) {
if ($this->filePath) {
if ( ! $this->storage) {
$this->storage = Storage::disk('local');
}
$this->storage->delete($this->filePath);
}
}

Loading…
Cancel
Save