Merge branch 'master' of ssh://git.kmlabz.com:2222/birbnetes/storage-service
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2021-08-09 13:57:08 +02:00
5 changed files with 34 additions and 3 deletions

View File

@@ -3,9 +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
from utils import register_all_error_handlers, storage, health_database_status
# import views
from views import ObjectView
@@ -32,6 +33,8 @@ 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)
@@ -39,6 +42,9 @@ register_all_error_handlers(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())
# start debugging if needed
if __name__ == "__main__":
app.run(debug=True)