Skip to content

Commit

Permalink
chore: healthz check connections every 5 min
Browse files Browse the repository at this point in the history
  • Loading branch information
terovirtanen committed Sep 30, 2024
1 parent 03524be commit ca76122
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions atv/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def check_db_connection():
health_status["db"] = {"message": "OK"}
except Exception as ex:
health_status["db"] = {"error": str(ex)}
time.sleep(30) # Sleep for 0.5 minutes
time.sleep(300) # Sleep for 5 minutes

def check_clamav_connection():

Check failure on line 93 in atv/urls.py

View workflow job for this annotation

GitHub Actions / Coding style - flake8

expected 2 blank lines, found 1
global health_status
Expand All @@ -99,7 +99,7 @@ def check_clamav_connection():
health_status["clamav"] = {"message": "OK"}
except Exception as ex:
health_status["clamav"] = {"error": str(ex)}
time.sleep(30) # Sleep for 0.5 minutes
time.sleep(300) # Sleep for 5 minutes

# Start the health check threads
threading.Thread(target=check_db_connection, daemon=True).start()

Check failure on line 105 in atv/urls.py

View workflow job for this annotation

GitHub Actions / Coding style - flake8

expected 2 blank lines after class or function definition, found 1
Expand Down

0 comments on commit ca76122

Please sign in to comment.