第一次提交
This commit is contained in:
23
backend/app/core/celery_app.py
Normal file
23
backend/app/core/celery_app.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Celery 应用配置
|
||||
"""
|
||||
from celery import Celery
|
||||
from app.core.config import settings
|
||||
|
||||
celery_app = Celery(
|
||||
"aiagent",
|
||||
broker=settings.REDIS_URL,
|
||||
backend=settings.REDIS_URL,
|
||||
include=["app.tasks.workflow_tasks", "app.tasks.agent_tasks"]
|
||||
)
|
||||
|
||||
celery_app.conf.update(
|
||||
task_serializer="json",
|
||||
accept_content=["json"],
|
||||
result_serializer="json",
|
||||
timezone="Asia/Shanghai",
|
||||
enable_utc=True,
|
||||
task_track_started=True,
|
||||
task_time_limit=30 * 60, # 30分钟
|
||||
task_soft_time_limit=25 * 60, # 25分钟
|
||||
)
|
||||
Reference in New Issue
Block a user