from celery import Celery from app.config import config celery_app = Celery( "rag_chatbot", broker=config["celery"]["broker_url"], backend=config["celery"]["result_backend"] ) 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=config["celery"]["task_time_limit"], worker_prefetch_multiplier=config["celery"]["worker_prefetch_multiplier"], worker_max_tasks_per_child=config["celery"]["worker_max_tasks_per_child"] ) celery_app.autodiscover_tasks(["workers"])