Files
mve-micro-docs/app/core/celery_app.py

26 lines
663 B
Python

"""Celery application configuration."""
from celery import Celery
from .config import get_settings
settings = get_settings()
celery_app = Celery(
"mve_incrementables_parser",
broker=settings.celery_broker_url,
backend=settings.celery_result_backend,
include=["app.tasks.parse_tasks"]
)
# Celery configuration
celery_app.conf.update(
task_serializer="json",
accept_content=["json"],
result_serializer="json",
timezone="UTC",
enable_utc=True,
task_track_started=True,
task_time_limit=300, # 5 minutes max
task_soft_time_limit=240, # 4 minutes soft limit
result_expires=3600, # Results expire after 1 hour
)