Browse Source

Fix issues

hidden_tags_with_bookmarks
Orzu Ionut 3 years ago
parent
commit
28e3fbd28b
  1. 12
      app/Ingest/Convertor.php
  2. 6
      app/Jobs/IngestDocuments.php
  3. 2
      app/Parser/ParseTextArray.php
  4. 2
      routes/web.php

12
app/Ingest/Convertor.php

@ -48,12 +48,12 @@ class Convertor
*/
private function convertToDocx()
{
(new Process(['export HOME=' . env('USER_HOME_PATH')]))->run();
/**
* Convert doc,dot,rtf,odt to docx
*/
$process = new Process([
'sudo',
'-S',
'soffice',
'--headless',
'--convert-to',
@ -82,9 +82,9 @@ class Convertor
*/
private function convertDocumentToText()
{
(new Process(['export HOME=' . env('USER_HOME_PATH')]))->run();
$process = new Process([
'sudo',
'-S',
'soffice',
'--headless',
'--convert-to',
@ -144,9 +144,9 @@ class Convertor
private function convertToHtml()
{
(new Process(['export HOME=' . env('USER_HOME_PATH')]))->run();
$process = new Process([
'sudo',
'-S',
'soffice',
'--headless',
'--convert-to',

6
app/Jobs/IngestDocuments.php

@ -94,7 +94,7 @@ class IngestDocuments implements ShouldQueue
SendToCore::dispatch($filePath);
} catch (\Exception $e) {
Log::error('Error writing in to the file' . $e->getMessage());
Log::error('Error writing in to the file: ' . $e->getMessage());
// report($e);
}
@ -102,6 +102,10 @@ class IngestDocuments implements ShouldQueue
public function failed()
{
if ( ! $this->storage) {
$this->storage = Storage::disk('local');
}
Log::error('Ingest documents failed.');
// @TODO Delete docx, txt and md files.

2
app/Parser/ParseTextArray.php

@ -123,7 +123,7 @@ class ParseTextArray
return $this->buildTheStructure(array_filter(explode(PHP_EOL, $fileContent)));
} else {
Log::error('The given file dose not exists!');
Log::error('The given file does not exists!');
}
}

2
routes/web.php

@ -3,5 +3,5 @@
Route::post('/ingest', 'IngestController@store');
Route::get('/', function () {
return 3;
return 1;
});
Loading…
Cancel
Save