task model

This commit is contained in:
2023-03-11 09:54:47 +08:00
parent 80fb9a4093
commit 789337707e
2 changed files with 6 additions and 8 deletions

View File

@@ -92,10 +92,8 @@ async def get_tasks():
@app.post("/tasks", response_model=Task)
async def create_task():
return task_manager.add({
"name": "test",
})
async def create_task(task: Task):
return task_manager.add(task)
# 维护一个任务队列, 任务队列中的任务会被分发给worker节点
# 任务状态变化时通知对应的客户端