From 5138d3cb32436a5ddd3392b2d244120407cff5fb Mon Sep 17 00:00:00 2001 From: Mardone Date: Thu, 11 Jul 2024 17:13:30 -0300 Subject: [PATCH] add more debug prints --- app/celery.py | 2 +- app/indexer/indexer_file_manager.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/celery.py b/app/celery.py index e9fc49f..73c01d6 100644 --- a/app/celery.py +++ b/app/celery.py @@ -21,7 +21,7 @@ @celery.task(name="index_file") def index_file_data(content_base: Dict) -> bool: from app.main import main_app - print("Start indexing") + print("Start task") file_downloader = S3FileDownloader( os.environ.get("AWS_STORAGE_ACCESS_KEY"), diff --git a/app/indexer/indexer_file_manager.py b/app/indexer/indexer_file_manager.py index 5a2dc71..e1ee060 100644 --- a/app/indexer/indexer_file_manager.py +++ b/app/indexer/indexer_file_manager.py @@ -53,22 +53,29 @@ def index_file_url(self, content_base, **kwargs) -> bool: docs: List[Document] full_content: str - + print("Start load_filk_url_and_split_text") docs, full_content = load_file_url_and_split_text( content_base.get("file"), content_base.get('extension_file'), self.text_splitter, load_type=load_type ) + print("End load_filk_url_and_split_text") + print("Start add_file_metadata") document_pages: List[Document] = add_file_metadata(docs, content_base) + print("End add_file_metadata") try: + print("Start index_documents") self.content_base_indexer.index_documents(document_pages) + print("End index_documents") + print("Start index_doc_content") self.content_base_indexer.index_doc_content( full_content=full_content, content_base_uuid=str(content_base.get('content_base')), filename=content_base.get("filename"), file_uuid=content_base.get("file_uuid"), ) + print("End index_doc_content") return True except Exception as e: # TODO: handle exceptions logger.exception(e)