From 892e5faec455b47bb5d115a50b2dd378a673fbf5 Mon Sep 17 00:00:00 2001 From: DJP Date: Wed, 10 Dec 2025 21:35:42 -0500 Subject: [PATCH] Move image upscaling to Celery queue for better reliability --- backend/app/api/v1/modules.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/api/v1/modules.py b/backend/app/api/v1/modules.py index b7f720b..7c4fa15 100644 --- a/backend/app/api/v1/modules.py +++ b/backend/app/api/v1/modules.py @@ -23,7 +23,7 @@ from app.services import ( markdown_tools, sound_effects ) -from app.workers.tasks import process_video_generation +from app.workers.tasks import process_video_generation, process_image_upscaling router = APIRouter() @@ -347,7 +347,8 @@ async def upscale_image( db.commit() db.refresh(job) - background_tasks.add_task(image_upscaler.upscale, str(job.id)) + # Offload to Celery Worker (Redis) for scalability + process_image_upscaling.delay(str(job.id)) return job_response(job)