This commit is contained in:
13
birb_scheduler_teller/utils/healthchecks.py
Normal file
13
birb_scheduler_teller/utils/healthchecks.py
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
from healthcheck import HealthCheck
|
||||
from flask import Flask
|
||||
|
||||
|
||||
def health_database_status():
|
||||
return True, f'db is ok'
|
||||
|
||||
|
||||
def register_health_checks(app: Flask):
|
||||
health = HealthCheck()
|
||||
health.add_check(health_database_status)
|
||||
app.add_url_rule("/healthz", "healthcheck", view_func=lambda: health.run())
|
||||
Reference in New Issue
Block a user