Files
video-service/app/celery_app.py

35 lines
832 B
Python
Executable File

"""
Celery Application Configuration
"""
from celery import Celery
from app.config import get_settings
settings = get_settings()
celery_app = Celery(
"video_tasks",
broker=settings.redis_url,
backend=settings.redis_url,
include=["app.tasks.video_tasks"],
)
# Celery Configuration
celery_app.conf.update(
task_serializer="json",
accept_content=["json"],
result_serializer="json",
timezone="Europe/Vienna",
enable_utc=True,
# Task settings
task_track_started=True,
task_time_limit=3600, # 1 hour hard limit
task_soft_time_limit=3300, # 55 min soft limit
# Worker settings
worker_prefetch_multiplier=1, # One task at a time for video processing
worker_concurrency=2,
# Result settings
result_expires=86400, # 24 hours
)