Refactored health checks
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -3,10 +3,10 @@ import sentry_sdk
|
||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||
from flask import Flask
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
from healthcheck import HealthCheck
|
||||
|
||||
|
||||
# import stuff
|
||||
from utils import register_all_error_handlers, storage, health_database_status
|
||||
from utils import register_all_error_handlers, storage, register_health_checks
|
||||
|
||||
# import views
|
||||
from views import ObjectView
|
||||
@@ -38,8 +38,6 @@ app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1)
|
||||
# init stuff
|
||||
storage.init_app(app)
|
||||
|
||||
health = HealthCheck()
|
||||
|
||||
# register error handlers
|
||||
register_all_error_handlers(app)
|
||||
|
||||
@@ -58,8 +56,7 @@ tracing = FlaskTracing(initialize_tracer, True, app)
|
||||
for view in [ObjectView]:
|
||||
view.register(app, trailing_slash=False)
|
||||
|
||||
health.add_check(health_database_status)
|
||||
app.add_url_rule("/healthz", "healthcheck", view_func=lambda: health.run())
|
||||
register_health_checks(app)
|
||||
|
||||
# start debugging if needed
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user