FastAPI + Celery + Redis + MariaDB stack with 6-service docker-compose. Includes project skeleton (config, database, models, tasks, migrations) and health endpoint with passing test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
620 B
Python
23 lines
620 B
Python
from celery import Celery
|
|
|
|
from web.config import settings
|
|
|
|
celery_app = Celery("evosync", broker=settings.REDIS_URL, backend=settings.REDIS_URL)
|
|
|
|
celery_app.conf.update(
|
|
task_serializer="json",
|
|
result_serializer="json",
|
|
accept_content=["json"],
|
|
timezone="Europe/Moscow",
|
|
enable_utc=True,
|
|
task_track_started=True,
|
|
task_acks_late=True,
|
|
worker_prefetch_multiplier=1,
|
|
broker_connection_retry_on_startup=True,
|
|
task_routes={
|
|
"web.tasks.sync.*": {"queue": "sync"},
|
|
"web.tasks.health.*": {"queue": "health"},
|
|
"web.tasks.catalog.*": {"queue": "default"},
|
|
},
|
|
)
|