From 6954f4eb0ebcc615a901f6ccdf1e5abdd59b2642 Mon Sep 17 00:00:00 2001 From: Zamil Majdy Date: Thu, 21 Nov 2024 17:46:55 +0700 Subject: [PATCH] fix(backend): Revert non-async routes that are changed to async (#8734) --- autogpt_platform/backend/backend/server/rest_api.py | 4 +--- autogpt_platform/backend/backend/server/routers/v1.py | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/autogpt_platform/backend/backend/server/rest_api.py b/autogpt_platform/backend/backend/server/rest_api.py index 2436e4115..59b7f04af 100644 --- a/autogpt_platform/backend/backend/server/rest_api.py +++ b/autogpt_platform/backend/backend/server/rest_api.py @@ -91,9 +91,7 @@ class AgentServer(backend.util.service.AppProcess): async def test_execute_graph( graph_id: str, node_input: dict[typing.Any, typing.Any], user_id: str ): - return await backend.server.routers.v1.execute_graph( - graph_id, node_input, user_id - ) + return backend.server.routers.v1.execute_graph(graph_id, node_input, user_id) @staticmethod async def test_create_graph( diff --git a/autogpt_platform/backend/backend/server/routers/v1.py b/autogpt_platform/backend/backend/server/routers/v1.py index 11d4c6a73..a44f25c1a 100644 --- a/autogpt_platform/backend/backend/server/routers/v1.py +++ b/autogpt_platform/backend/backend/server/routers/v1.py @@ -276,7 +276,7 @@ async def set_graph_active_version( tags=["graphs"], dependencies=[Depends(auth_middleware)], ) -async def execute_graph( +def execute_graph( graph_id: str, node_input: dict[Any, Any], user_id: Annotated[str, Depends(get_user_id)], @@ -481,7 +481,7 @@ async def create_schedule( tags=["schedules"], dependencies=[Depends(auth_middleware)], ) -async def delete_schedule( +def delete_schedule( schedule_id: str, user_id: Annotated[str, Depends(get_user_id)], ) -> dict[Any, Any]: @@ -494,7 +494,7 @@ async def delete_schedule( tags=["schedules"], dependencies=[Depends(auth_middleware)], ) -async def get_execution_schedules( +def get_execution_schedules( user_id: Annotated[str, Depends(get_user_id)], graph_id: str | None = None, ) -> list[scheduler.JobInfo]: