Initial commit: BtToxin Pipeline project structure
This commit is contained in:
21
backend/app/core/celery_app.py
Normal file
21
backend/app/core/celery_app.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""Celery 配置"""
|
||||
from celery import Celery
|
||||
from ..config import settings
|
||||
|
||||
celery_app = Celery(
|
||||
"bttoxin_worker",
|
||||
broker=settings.CELERY_BROKER_URL,
|
||||
backend=settings.CELERY_RESULT_BACKEND,
|
||||
include=['app.workers.tasks']
|
||||
)
|
||||
|
||||
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=7200,
|
||||
worker_prefetch_multiplier=1,
|
||||
)
|
||||
Reference in New Issue
Block a user