This commit is contained in:
@@ -4,9 +4,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
|
||||
@@ -41,6 +42,9 @@ app.config['MINIO_BUCKET_NAME'] = os.environ['MINIO_BUCKET_NAME']
|
||||
app.config['MINIO_SECURE'] = os.environ.get('MINIO_SECURE', False)
|
||||
app.config['MINIO_REGION'] = os.environ.get('MINIO_REGION', None)
|
||||
|
||||
health = HealthCheck(app, "/healthz")
|
||||
|
||||
|
||||
# register error handlers
|
||||
register_all_error_handlers(app)
|
||||
|
||||
@@ -48,6 +52,8 @@ register_all_error_handlers(app)
|
||||
for view in [ObjectView]:
|
||||
view.register(app, trailing_slash=False)
|
||||
|
||||
health.add_check(health_database_status)
|
||||
|
||||
# start debugging if needed
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
|
||||
Reference in New Issue
Block a user