mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
creating error page for tech difficulties
This commit is contained in:
13
app/utils/api_health.py
Normal file
13
app/utils/api_health.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import os
|
||||
|
||||
import requests
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
|
||||
def is_api_down():
|
||||
api_base_url = os.getenv("API_BASE_URL", "http://localhost:6011")
|
||||
try:
|
||||
response = requests.get(api_base_url, timeout=2)
|
||||
return response.status_code != 200
|
||||
except RequestException:
|
||||
return True
|
||||
Reference in New Issue
Block a user