feat: Add function to check if site is up
This commit is contained in:
parent
e6f12ce5b1
commit
0ccbb18411
@ -34,3 +34,11 @@ def healthcheck_ok():
|
|||||||
requests.get(settings.HEALTHCHECKS_URL, timeout=10)
|
requests.get(settings.HEALTHCHECKS_URL, timeout=10)
|
||||||
except requests.RequestException as e:
|
except requests.RequestException as e:
|
||||||
logging.error("Ping to healthcheck-server failed: %s" % e)
|
logging.error("Ping to healthcheck-server failed: %s" % e)
|
||||||
|
|
||||||
|
|
||||||
|
def is_404(url):
|
||||||
|
try:
|
||||||
|
result = requests.get(url, timeout=10)
|
||||||
|
return result.status_code == 404
|
||||||
|
except requests.RequestException as e:
|
||||||
|
logging.warning(f"Request to {url} failed: {e}")
|
||||||
|
Loading…
Reference in New Issue
Block a user