Files
youtube-microservice/app/core/celery.py
2026-02-22 22:38:01 +05:00

25 lines
521 B
Python

from celery import Celery
from app.core.config import REDIS_URL, ssl_options
celery_app = Celery(
"celery_worker",
broker=f"{REDIS_URL}/0",
backend=f"{REDIS_URL}/1",
)
celery_app.conf.update(
broker_use_ssl=ssl_options,
redis_backend_use_ssl=ssl_options,
task_serializer=["json"],
result_serializer=["json"],
accept_content=["json"],
enable_utc=True,
timezone="UTC",
broker_connection_retry_on_startup=True,
task_acks_late=True,
task_reject_on_worker_lost=True,
)