We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
services:health
Client
1 parent dc38ecd commit ccb7eb5Copy full SHA for ccb7eb5
1 file changed
src/shellsmith/services.py
@@ -2,7 +2,7 @@
2
3
import httpx
4
5
-from shellsmith import api
+from shellsmith import Client, api
6
from shellsmith.config import config
7
from shellsmith.extract import collect_submodel_ids
8
@@ -133,15 +133,8 @@ def health(timeout: float = 0.1, host: str = config.host) -> str:
133
Returns:
134
"UP" if the service is reachable, otherwise "DOWN".
135
"""
136
- url = f"{host}/actuator/health"
137
-
138
- try:
139
- response = httpx.get(url, timeout=timeout)
140
- response.raise_for_status()
141
- data = response.json()
142
- return data["status"]
143
- except httpx.RequestError:
144
- return "DOWN"
+ with Client(host=host) as client:
+ client.get_health_status()
145
146
147
def find_unreferenced_submodels(host: str = config.host) -> list[str]:
0 commit comments