remove async

This commit is contained in:
jxxghp
2023-07-09 11:51:29 +08:00
parent ae10cd2a6b
commit 7f029d7389
15 changed files with 150 additions and 152 deletions

View File

@ -9,7 +9,7 @@ from app.core.config import settings
router = APIRouter()
async def start_webhook_chain(body: Any, form: Any, args: Any):
def start_webhook_chain(body: Any, form: Any, args: Any):
"""
启动链式任务
"""
@ -17,15 +17,15 @@ async def start_webhook_chain(body: Any, form: Any, args: Any):
@router.post("/", summary="Webhook消息响应", response_model=schemas.Response)
async def webhook_message(background_tasks: BackgroundTasks,
token: str, request: Request) -> Any:
def webhook_message(background_tasks: BackgroundTasks,
token: str, request: Request) -> Any:
"""
Webhook响应
"""
if token != settings.API_TOKEN:
return schemas.Response(success=False, message="token认证不通过")
body = await request.body()
form = await request.form()
body = request.body()
form = request.form()
args = request.query_params
background_tasks.add_task(start_webhook_chain, body, form, args)
return schemas.Response(success=True)