Merge branch 'master' of ssh://git.kmlabz.com:2222/birbnetes/model-service
Some checks failed
continuous-integration/drone/push Build was killed
Some checks failed
continuous-integration/drone/push Build was killed
This commit is contained in:
@@ -3,11 +3,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
|
||||
@@ -23,6 +24,8 @@ if Config.SENTRY_DSN:
|
||||
sentry_sdk.init(
|
||||
dsn=Config.SENTRY_DSN,
|
||||
integrations=[FlaskIntegration()],
|
||||
_experiments={"auto_enabling_integrations": True},
|
||||
traces_sample_rate=1.0,
|
||||
send_default_pii=True,
|
||||
release=Config.RELEASE_ID,
|
||||
environment=Config.RELEASEMODE
|
||||
@@ -38,6 +41,7 @@ app.config.from_object(Config)
|
||||
# initialize stuff
|
||||
db.init_app(app)
|
||||
storage.init_app(app)
|
||||
health = HealthCheck()
|
||||
|
||||
|
||||
@app.before_first_request
|
||||
@@ -62,6 +66,9 @@ tracing = FlaskTracing(initialize_tracer, True, app)
|
||||
for view in [SVMView, CNNView, RootView]:
|
||||
view.register(app, trailing_slash=False, route_prefix='/model')
|
||||
|
||||
health.add_check(health_database_status)
|
||||
app.add_url_rule("/healthz", "healthcheck", view_func=lambda: health.run())
|
||||
|
||||
# start debuggig if needed
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
|
||||
Reference in New Issue
Block a user