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 php artisan queue:deploy-supervisor
supervisorctl start all supervisorctl start all
# PDF Convertor
apt-get install poppler-utils
# Tesseract OCR # Tesseract OCR
add-apt-repository ppa:alex-p/tesseract-ocr-devel add-apt-repository ppa:alex-p/tesseract-ocr-devel
apt-get update 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. // We are done with the images processing, delete directory.
$this->storage->deleteDirectory($this->path); $this->storage->deleteDirectory($this->path);
$this->path = "$this->path.md"; $this->path = "$this->path.md";
\Illuminate\Support\Facades\Log::info($this->path);
\Illuminate\Support\Facades\Log::info('++++++++++++++++++++++++++');
$this->storage->put($this->path, $imagesContent); $this->storage->put($this->path, $imagesContent);
} }

4
app/Jobs/IngestDocuments.php

@ -78,7 +78,11 @@ class IngestDocuments implements ShouldQueue
try { try {
$this->path = $convertor->execute(); $this->path = $convertor->execute();
} catch (\Exception $exception) { } catch (\Exception $exception) {
\Illuminate\Support\Facades\Log::info($exception->getMessage());
$this->failed(); $this->failed();
return;
} }
// @TODO Replace later, the convertor will create the .md file. // @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 && $sent) {
if ($this->filePath) { if ($this->filePath) {
if ( ! $this->storage) {
$this->storage = Storage::disk('local');
}
$this->storage->delete($this->filePath); $this->storage->delete($this->filePath);
} }
} }

Loading…
Cancel
Save