File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 1313import sentry_sdk
1414from sentry_sdk .integrations .flask import FlaskIntegration
1515from sentry_sdk .integrations .sqlalchemy import SqlalchemyIntegration
16+ from werkzeug .middleware .profiler import ProfilerMiddleware
1617
1718app = Flask (__name__ )
1819gzip = Gzip (app )
2930db = SQLAlchemy (app )
3031migrate = Migrate (app , db )
3132
33+ if app .config ['PROFILING' ]:
34+ app .wsgi_app = ProfilerMiddleware (
35+ app .wsgi_app ,
36+ restrictions = [30 ]
37+ )
38+
3239# Sentry setup
3340sentry_sdk .init (
3441 dsn = app .config ['SENTRY_DSN' ],
Original file line number Diff line number Diff line change 1515IP = env .get ("CONDITIONAL_IP" , "0.0.0.0" )
1616PORT = env .get ("CONDITIONAL_PORT" , 6969 )
1717WEBHOOK_URL = env .get ("CONDITIONAL_WEBHOOK_URL" , "INSERT URL HERE" )
18+ PROFILING = env .get ("CONDITIONAL_PROFILING" , "false" ).lower () == "true"
1819
1920# DB Info
2021SQLALCHEMY_DATABASE_URI = env .get ("SQLALCHEMY_DATABASE_URI" , "" )
You can’t perform that action at this time.
0 commit comments