Use health endpoint in check health

This commit is contained in:
Piero Toffanin
2025-12-04 00:49:31 -05:00
parent c7b71d72c6
commit 9cb966c3f6
+3 -7
View File
@@ -2,14 +2,10 @@ import requests
import os
port = os.environ.get('LT_PORT', '5000')
response = requests.post(
url=f'http://localhost:{port}/translate',
response = requests.get(
url=f'http://localhost:{port}/health',
headers={'Content-Type': 'application/json'},
json={
'q': 'Hello World!',
'source': 'en',
'target': 'en'
},
json={},
timeout=60
)
response.raise_for_status() # if server unavailable then requests with raise exception and healthcheck will fail