This commit is contained in:
@@ -4,11 +4,12 @@ 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 model import db
|
||||
|
||||
from utils import register_all_error_handlers, storage
|
||||
from utils import register_all_error_handlers, storage, health_database_status
|
||||
|
||||
# import views
|
||||
from views import SVMView, CNNView, RootView
|
||||
@@ -47,6 +48,7 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||
# initialize stuff
|
||||
db.init_app(app)
|
||||
storage.init_app(app)
|
||||
health = HealthCheck(app, "/healthz")
|
||||
|
||||
|
||||
@app.before_first_request
|
||||
@@ -61,6 +63,8 @@ register_all_error_handlers(app)
|
||||
for view in [SVMView, CNNView, RootView]:
|
||||
view.register(app, trailing_slash=False, route_prefix='/model')
|
||||
|
||||
health.add_check(health_database_status)
|
||||
|
||||
# start debuggig if needed
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
|
||||
Reference in New Issue
Block a user