Skip to content

Commit

Permalink
Debug requests error on ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
emileswarts committed Feb 19, 2025
1 parent ebe9e7d commit d66df0c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions trade_remedies_api/core/healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ def ping_opensearch():
:return: the response from OpenSearch
"""
print("requesting http")
requests.get("http://example.com", timeout=20)

print("requesting https")
requests.get("https://example.com", timeout=20)
response = requests.get(settings.OPENSEARCH_URI, timeout=20)
return response

Expand All @@ -66,14 +71,11 @@ def _pingdom_custom_status_html_wrapper(status_str: str, response_time_value: fl
response data format:
https://documentation.solarwinds.com/en/success_center/pingdom/content/topics/http-custom-check.htm?cshid=pd-rd_115000431709-http-custom-check
"""
root = ET.Element("root")
pingdom_http_custom_check = ET.SubElement(root, "pingdom_http_custom_check")
status = ET.SubElement(pingdom_http_custom_check, "status")
strong = ET.SubElement(status, "strong")
strong.text = str(status_str)
response_time = ET.SubElement(pingdom_http_custom_check, "response_time")
strong = ET.SubElement(response_time, "strong")
strong.text = str(response_time_value)
root = ET.Element("pingdom_http_custom_check")
# status = ET.SubElement(root, "status")
# status.text = str(status_str)
# response_time = ET.SubElement(root, "response_time")
# response_time.text = str(response_time_value)
xml = ET.tostring(root, encoding="unicode", method="xml")
return xml

Expand Down

0 comments on commit d66df0c

Please sign in to comment.