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
@@ -9,7 +9,7 @@ import re
from datetime import datetime, timedelta, timezone
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
from app.tasks.convert_to_pdf import convert_to_pdf # new conversion task
logger = logging.getLogger(__name__)
@@ -306,7 +306,7 @@ def fetch_attachments_and_enqueue(email_message):
f.write(part.get_payload(decode=True))
if mime_type == "application/pdf":
upload_to_s3.delay(file_path)
process_document.delay(file_path) # Updated function call
logger.info("Enqueued PDF for upload: %s", filename)
elif mime_type in ALLOWED_MIME_TYPES:
# Enqueue conversion to PDF using the Gotenberg service.