perf(douyu): 拆分任务槽并改造绑定扫码调度
This commit is contained in:
@@ -9,6 +9,7 @@ from hmac import compare_digest
|
||||
from typing import Any
|
||||
|
||||
from fastapi import APIRouter, Depends, Header, HTTPException, Request
|
||||
from fastapi.responses import JSONResponse
|
||||
from sqlalchemy.orm import Session
|
||||
from starlette.requests import ClientDisconnect
|
||||
|
||||
@@ -132,12 +133,16 @@ async def start_customer_binding(
|
||||
task_id: int,
|
||||
req: PlatformFulfillmentCustomerBindingAction,
|
||||
db: Session = Depends(get_db),
|
||||
) -> dict[str, Any]:
|
||||
return await service.customer_start_binding(
|
||||
) -> JSONResponse:
|
||||
payload = await service.customer_start_binding(
|
||||
db,
|
||||
task_id=task_id,
|
||||
force_refresh=req.force_refresh,
|
||||
)
|
||||
return JSONResponse(
|
||||
status_code=202 if payload.get("accepted") else 200,
|
||||
content=payload,
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
|
||||
Reference in New Issue
Block a user