Spaces:
Sleeping
Sleeping
File size: 631 Bytes
64d7fdf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 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"])
|