Skip to content

Commit

Permalink
Fix crash error
Browse files Browse the repository at this point in the history
  • Loading branch information
NotChristianGarcia authored Dec 8, 2023
1 parent a779fa3 commit 7f14cee
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions service/health_central.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)


Expand Down

0 comments on commit 7f14cee

Please sign in to comment.