You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kmftools/bookscraper/celery_app.py

22 lines
479 B

# celery_app.py
from celery import Celery
import os
REDIS_URL = os.getenv("REDIS_URL", "redis://redis:6379/0")
celery_app = Celery(
"bookscraper",
broker=REDIS_URL,
backend=REDIS_URL
)
celery_app.conf.update(
task_default_queue="default",
task_routes={
"tasks.scraping.*": {"queue": "scraping"},
"tasks.audio.*": {"queue": "audio"},
},
worker_prefetch_multiplier=1, # important for concurrency=1 workers
task_acks_late=True,
)