1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-11-24 08:02:18 +02:00
LibreTranslate/scripts/healthcheck.py

14 lines
335 B
Python
Raw Permalink Normal View History

import requests
2023-07-09 12:29:11 +02:00
response = requests.post(
2024-03-06 16:46:29 +02:00
url='http://localhost:5000/translate',
headers={'Content-Type': 'application/json'},
json={
'q': 'Hello World!',
'source': 'en',
'target': 'en'
},
timeout=60
)
# if server unavailable then requests with raise exception and healthcheck will fail