@@ -63,9 +63,13 @@ def _database_dependency_status() -> str:
6363 return "DOWN"
6464
6565
66- def _health_payload () -> tuple [dict , HTTPStatus ]:
66+ def _cache_dependency_status () -> str :
67+ return "UP" if get_cache_enabled () else "DOWN"
68+
69+
70+ def get_health_payload () -> tuple [dict , HTTPStatus ]:
6771 database_status = _database_dependency_status ()
68- cache_status = "UP" if get_cache_enabled () else "DOWN"
72+ cache_status = _cache_dependency_status ()
6973 overall_status = "UP" if database_status == "UP" else "DOWN"
7074 status_code = (
7175 HTTPStatus .OK if overall_status == "UP" else HTTPStatus .SERVICE_UNAVAILABLE
@@ -101,7 +105,7 @@ def register_namespaces(api: Api) -> None:
101105
102106 api .add_namespace (continents_ns , path = "/continents" )
103107 api .add_namespace (countries_ns , path = "/countries" )
104- api .add_namespace (general_ns , path = "/ " )
108+ api .add_namespace (general_ns , path = "" )
105109 api .add_namespace (states_ns , path = "/states" )
106110 api .add_namespace (cities_ns , path = "/cities" )
107111
@@ -133,11 +137,6 @@ def create_app():
133137 def healthz ():
134138 return {"status" : "ok" }, HTTPStatus .OK
135139
136- @app .route ("/health" )
137- def health ():
138- payload , status = _health_payload ()
139- return payload , status
140-
141140 @app .route ("/readyz" )
142141 def readyz ():
143142 try :
0 commit comments