fixed: asyncio.run() cannot be called from a running event loop

This commit is contained in:
harry
2024-03-16 08:55:15 +08:00
parent 8b9ff47cad
commit b5ba1e6b09
4 changed files with 36 additions and 25 deletions

View File

@@ -26,7 +26,7 @@ async def create_video(request: Request, body: TaskVideoRequest):
}
body_dict = body.dict()
task.update(body_dict)
result = tm.start(task_id=task_id, params=body)
result = await tm.start(task_id=task_id, params=body)
task["result"] = result
logger.success(f"video created: {utils.to_json(task)}")
return utils.get_response(200, task)