diff --git a/src/fellchensammlung/tools/misc.py b/src/fellchensammlung/tools/misc.py index 6c94b47..6eb9fdd 100644 --- a/src/fellchensammlung/tools/misc.py +++ b/src/fellchensammlung/tools/misc.py @@ -34,3 +34,11 @@ def healthcheck_ok(): requests.get(settings.HEALTHCHECKS_URL, timeout=10) except requests.RequestException as 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}")