11.25 qianwen-long
This commit is contained in:
parent
40151bb5fc
commit
46a30b7d00
@ -1,3 +1,4 @@
|
|||||||
|
# flask_app/celery_app
|
||||||
import os
|
import os
|
||||||
from celery import Celery
|
from celery import Celery
|
||||||
|
|
||||||
|
@ -49,4 +49,4 @@ def create_app():
|
|||||||
#TODO:接口设置排队
|
#TODO:接口设置排队
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = create_app()
|
app = create_app()
|
||||||
app.run(debug=True, host='0.0.0.0', port=5000)
|
app.run(debug=True, host='0.0.0.0', port=5001)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# flask_app/task
|
||||||
from flask_app.celery_app import celery_app
|
from flask_app.celery_app import celery_app
|
||||||
from flask_app.general.通义千问long import qianwen_long
|
from flask_app.general.通义千问long import qianwen_long
|
||||||
|
|
||||||
@ -7,9 +8,9 @@ from flask_app.general.通义千问long import qianwen_long
|
|||||||
soft_time_limit=600, # 10分钟后发出超时信号
|
soft_time_limit=600, # 10分钟后发出超时信号
|
||||||
time_limit=660
|
time_limit=660
|
||||||
)
|
)
|
||||||
def process_qianwen_long(file_id, user_query):
|
def process_qianwen_long(self, file_id, user_query):
|
||||||
try:
|
try:
|
||||||
return qianwen_long(file_id, user_query)
|
return qianwen_long(file_id, user_query)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
# 如果发生异常,重试任务
|
print("任务发生异常,准备重试")
|
||||||
print("no")
|
raise self.retry(exc=exc)
|
Loading…
x
Reference in New Issue
Block a user