11.25 qianwen-long

This commit is contained in:
zy123 2024-11-25 17:18:30 +08:00
parent a2bd20eb0d
commit 0a0770d5b4
3 changed files with 5 additions and 2 deletions

View File

@ -19,3 +19,4 @@ celery_app.conf.update(
timezone='UTC', # 设置时区(可根据需要修改)
enable_utc=True # 确保 UTC 时间生效
)
celery_app.autodiscover_tasks(['flask_app.task'])

View File

@ -1,6 +1,6 @@
# flask_project/flask_app/routes.py
from flask import request, jsonify
from flask_app.tasks import process_qianwen_long
from flask_app.task import process_qianwen_long
def register_routes(app):
@app.route('/api/qianwen_long', methods=['POST'])

View File

@ -7,7 +7,9 @@ from flask_app.general.通义千问long import qianwen_long
name='flask_app.task.process_qianwen_long',
bind=True,
soft_time_limit=600, # 10分钟后发出超时信号
time_limit=660
time_limit=660,
max_retries=3, # 最大重试次数
default_retry_delay=60 # 重试延迟时间(秒)
)
def process_qianwen_long(self, file_id, user_query):
try: