Files
admin 2803c81b44
Mirror and run GitLab CI / build (push) Has been cancelled
Ruff / ruff (push) Has been cancelled
Implement async processing with Celery, Redis, and queue-based email notifications
2026-06-14 14:38:10 +00:00

29 lines
639 B
Python

"""
Celery application for async transcription jobs.
"""
import os
from celery import Celery
broker_url = os.getenv("CELERY_BROKER_URL", "redis://redis:6379/0")
result_backend = os.getenv("CELERY_RESULT_BACKEND", "redis://redis:6379/0")
celery_app = Celery(
"scraibe",
broker=broker_url,
backend=result_backend,
)
celery_app.conf.update(
task_routes={
"scraibe.tasks.process_transcription_task": {"queue": "transcription"},
},
task_serializer="json",
result_serializer="json",
accept_content=["json"],
timezone="UTC",
enable_utc=True,
)
celery_app.autodiscover_tasks(["scraibe.tasks"])