From 7f14cee8c4f67dd6fcca8810961737c0cdf782ff Mon Sep 17 00:00:00 2001 From: "Christian R. Garcia" Date: Thu, 7 Dec 2023 16:48:18 -0800 Subject: [PATCH] Fix crash error --- service/health_central.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/service/health_central.py b/service/health_central.py index 763d421..09f803f 100644 --- a/service/health_central.py +++ b/service/health_central.py @@ -221,6 +221,9 @@ def set_traefik_proxy(): def main(): + """ + Main function for health checks. + """ # Try and run check_db_pods. Will try for 60 seconds until health is declared "broken". logger.info("Top of health. Checking if db's are initialized.") idx = 0 @@ -245,10 +248,19 @@ def main(): # Main health loop while True: logger.info(f"Running pods health checks. Now: {time.time()}") - check_nfs_files() - - set_traefik_proxy() - ### Have a short wait + try: + set_traefik_proxy() + except Exception as e: + logger.error(f"Error setting traefik proxy. e: {e}") + raise + + try: + check_nfs_files() + except Exception: + logger.error(f"Error running check_nfs_files. e: {e}") + #raise # this seems like it's just breaking + + # Have a short wait time.sleep(3)