mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-31 11:30:28 -04:00
revert api health changes
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import logging
|
||||
import os
|
||||
import ssl
|
||||
|
||||
import requests
|
||||
from requests.exceptions import RequestException
|
||||
@@ -8,17 +7,10 @@ from requests.exceptions import RequestException
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Is this right and can we use it anywhere?
|
||||
def get_no_x509_strict_context():
|
||||
context = ssl.create_default_context()
|
||||
context.verify_flags &= ~ssl.VERIFY_X509_STRICT
|
||||
return context
|
||||
|
||||
|
||||
def is_api_down():
|
||||
api_base_url = os.getenv("API_HOST_NAME")
|
||||
try:
|
||||
response = requests.get(api_base_url, timeout=2, verify=False) # nosec
|
||||
response = requests.get(api_base_url, timeout=2)
|
||||
is_down = response.status_code != 200
|
||||
if is_down:
|
||||
logger.warning(
|
||||
|
||||
Reference in New Issue
Block a user