Fix crashes

This commit is contained in:
Florian Kaiser 2024-08-17 08:46:02 +02:00
parent de834b16e5
commit f3015ea2f0

21
main.py
View File

@ -82,11 +82,20 @@ def check_email():
logging.debug(r.status_code)
if __name__ == "__main__":
while True:
logging.debug("Loop")
check_email()
try:
while True:
logging.debug("Loop")
check_email()
r = requests.get(HEALTHCHECK_URL + "?status=up&msg=OK&ping=")
logging.debug(r.status_code)
r = requests.get(HEALTHCHECK_URL + "?status=up&msg=OK&ping=")
logging.debug(r.status_code)
time.sleep(CHECK_INTERVAL)
except Exception as e:
try:
logging.error(f'Fehler: {e}')
time.sleep(CHECK_INTERVAL)
r = requests.get(HEALTHCHECK_URL + "?status=down&msg=Unknown error&ping=")
logging.debug(r.status_code)
except:
pass