Skip to content

Commit

Permalink
add more debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
zMardone committed Jul 11, 2024
1 parent 8411b83 commit 5138d3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
9 changes: 8 additions & 1 deletion app/indexer/indexer_file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5138d3c

Please sign in to comment.