From 99a2fd4b65be253b71d2db68c1c2e39867715545 Mon Sep 17 00:00:00 2001 From: DingZQ Date: Sat, 15 Oct 2022 17:19:54 +0800 Subject: [PATCH] Batch --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 1ddf9ad..a012c8e 100644 --- a/main.py +++ b/main.py @@ -93,13 +93,13 @@ async def fastapi_get_current_operaiton_id(network: str) -> int: return get_current_operation(network) @app.get("/syncwithserver/") -def fastapi_sync_with_server(network: str, operationid: int) -> ChangeSet: +async def fastapi_sync_with_server(network: str, operationid: int) -> ChangeSet: return sync_with_server(network, operationid) @app.post("/batch/") -def fastapi_execute_batch_commands(network: str, request: Request) -> ChangeSet: +async def fastapi_execute_batch_commands(network: str, request: Request) -> ChangeSet: print(request) - jsTxt = request.json() + jsTxt = await request.json() print(jsTxt) joOps = json.loads(jsTxt)['operations'] cs:ChangeSet = ChangeSet({})