rogerxavier commited on
Commit
03b9d71
1 Parent(s): 1ad0d49

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +2 -2
api.py CHANGED
@@ -100,9 +100,9 @@ async def execute_py_file(file_name: str,background_tasks: BackgroundTasks):
100
  # background_tasks.add_task(file_executer,"3mergeDialogToVideo")
101
  # return {"message": "Tasks added to the queue"}
102
 
103
- #收到图片后为了后台任务的顺序,单独设定一个函数依次将自定义执行顺序加入队列
104
  @app.get("/execute_all_task")
105
- async def execute_all_task(file_list: list = ["1removeMask", "2magiDialogCut", "3mergeDialogToVideo"], background_tasks: BackgroundTasks):
106
  for file_name in file_list:
107
  background_tasks.add_task(file_executer, file_name)
108
  return {"message": "Tasks added to the queue"}
 
100
  # background_tasks.add_task(file_executer,"3mergeDialogToVideo")
101
  # return {"message": "Tasks added to the queue"}
102
 
103
+ #收到图片后为了后台任务的顺序,单独设定一个函数依次将自定义执行顺序加入队列 ,有默认参数的写后面
104
  @app.get("/execute_all_task")
105
+ async def execute_all_task(background_tasks: BackgroundTasks,file_list: list = ["1removeMask", "2magiDialogCut", "3mergeDialogToVideo"]):
106
  for file_name in file_list:
107
  background_tasks.add_task(file_executer, file_name)
108
  return {"message": "Tasks added to the queue"}