Skip to content

Commit

Permalink
return a 504 if anything is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdavis2001 committed May 1, 2024
1 parent 17c7669 commit 72c4a75
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lambda_functions/v1/functions/lpa/app/api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,20 @@ def handle504(error=None):
def handle_healthcheck_route():
response_message = get_service_status()

return jsonify(response_message), 200
if (
"data" in response_message
and "sirius-status" in response_message["data"]
and response_message["data"]["sirius-status"] != "Unavailable"
and "cache-status" in response_message["data"]
and response_message["data"]["cache-status"] != "Unavailable"
and "api-status" in response_message["data"]
and response_message["data"]["api-status"] != "Unavailable"
):
return_code = 200
else:
return_code = 504

return jsonify(response_message), return_code


@api.route("/lpa-online-tool/lpas/<lpa_online_tool_id>", methods=["GET"])
Expand Down

0 comments on commit 72c4a75

Please sign in to comment.