Move image upscaling to Celery queue for better reliability
This commit is contained in:
parent
7aeb2426ed
commit
892e5faec4
1 changed files with 3 additions and 2 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue