From 3b94daae3b97f1eed39564c78656f16e2939418e Mon Sep 17 00:00:00 2001 From: Derek Fitchett <135860892+dfitchett@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:30:45 -0800 Subject: [PATCH] Make rest endpoint functions async (#31) --- docker-entrypoint.sh | 2 -- src/python_src/api.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100755 docker-entrypoint.sh diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh deleted file mode 100755 index 0b0c155..0000000 --- a/docker-entrypoint.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec uvicorn python_src.api:app --host 0.0.0.0 --port 8130 diff --git a/src/python_src/api.py b/src/python_src/api.py index 63a2484..dc79c7a 100644 --- a/src/python_src/api.py +++ b/src/python_src/api.py @@ -28,7 +28,7 @@ @app.get('/health') -def get_health_status() -> dict[str, str]: +async def get_health_status() -> dict[str, str]: if not MAX_RATINGS_BY_CODE: raise HTTPException(status_code=500, detail='Max Rating by Diagnostic Code Lookup table is empty.') @@ -40,7 +40,7 @@ def get_health_status() -> dict[str, str]: # replacing the legacy '/cfi/max-ratings' path that was specific to LHDI cloud. # This will require new API gateway configuration in the VA.gov cloud environment. For more details, see: https://github.com/department-of-veterans-affairs/abd-vro/issues/3850 @app.post('/disability-max-ratings') -def get_max_ratings( +async def get_max_ratings( claim_for_increase: MaxRatingsForClaimForIncreaseRequest, ) -> MaxRatingsForClaimForIncreaseResponse: ratings = []