refactor: rename upload_to_s3 to process_document

- Rename upload_to_s3.py to process_document.py to better reflect its purpose
- Update all import statements across the codebase to use new module name
- Remove S3-specific code and references
- Keep the core document processing logic intact
- Update docstrings and comments to reflect new functionality

This change is part of removing AWS S3 dependencies and simplifying the
document processing pipeline.
This commit is contained in:
Christian Krakau-Louis
2025-03-27 14:50:51 +01:00
parent e1caa144f2
commit de06fd1286
7 changed files with 42 additions and 52 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import logging
import mimetypes
from celery import shared_task
from app.config import settings
from app.tasks.upload_to_s3 import upload_to_s3
from app.tasks.process_document import process_document # Updated import
logger = logging.getLogger(__name__)
@@ -64,7 +64,7 @@ def convert_to_pdf(file_path):
with open(converted_file_path, "wb") as out_file:
out_file.write(response.content)
logger.info(f"Converted file saved as PDF: {converted_file_path}")
upload_to_s3.delay(converted_file_path)
process_document.delay(converted_file_path) # Updated function call
return converted_file_path
else:
logger.error(f"Conversion failed for {file_path}. Status code: {response.status_code}")