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