From 577926540cc32873b3564abe404356c524280f01 Mon Sep 17 00:00:00 2001 From: Orzu Ionut Date: Thu, 3 Jun 2021 15:21:40 +0300 Subject: [PATCH] Send failed request when document file content cannot be read --- app/Jobs/IngestDocuments.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Jobs/IngestDocuments.php b/app/Jobs/IngestDocuments.php index a69ddd2..010b5d9 100644 --- a/app/Jobs/IngestDocuments.php +++ b/app/Jobs/IngestDocuments.php @@ -78,6 +78,8 @@ class IngestDocuments implements ShouldQueue $content = $this->getContent(); if ( ! $content) { + $this->failed(); + return; } @@ -102,12 +104,12 @@ class IngestDocuments implements ShouldQueue Log::error('Ingest documents failed.'); - // @TODO Delete docx, txt and md files. - if ($this->storage->exists($this->path)) { - $this->storage->delete($this->path); - } +// // @TODO Delete docx, txt and md files. +// if ($this->storage->exists($this->path)) { +// $this->storage->delete($this->path); +// } - SendToCore::dispatch(null); + SendToCore::dispatch($this->path); } protected function getContent()