26 lines
613 B
Python
26 lines
613 B
Python
|
|
from celery import Celery
|
||
|
|
|
||
|
|
from app.core.config import settings
|
||
|
|
|
||
|
|
celery_app = Celery(
|
||
|
|
"fund_tracer",
|
||
|
|
broker=settings.REDIS_URL,
|
||
|
|
backend=settings.REDIS_URL,
|
||
|
|
)
|
||
|
|
|
||
|
|
celery_app.conf.update(
|
||
|
|
task_serializer="json",
|
||
|
|
accept_content=["json"],
|
||
|
|
result_serializer="json",
|
||
|
|
timezone="Asia/Shanghai",
|
||
|
|
enable_utc=True,
|
||
|
|
task_track_started=True,
|
||
|
|
task_routes={
|
||
|
|
"app.workers.ocr_tasks.*": {"queue": "ocr"},
|
||
|
|
"app.workers.analysis_tasks.*": {"queue": "analysis"},
|
||
|
|
"app.workers.report_tasks.*": {"queue": "reports"},
|
||
|
|
},
|
||
|
|
)
|
||
|
|
|
||
|
|
celery_app.autodiscover_tasks(["app.workers"])
|