first commit
This commit is contained in:
25
backend/app/workers/celery_app.py
Normal file
25
backend/app/workers/celery_app.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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"])
|
||||
Reference in New Issue
Block a user