fix application profiling
This commit is contained in:
parent
0a247a7927
commit
6374d8a9e1
@ -169,13 +169,16 @@ def make_app(conf=None):
|
||||
logger.warn("unable to connect to HTTP server")
|
||||
|
||||
if isso.conf.getboolean("server", "profile"):
|
||||
from werkzeug.contrib.profiler import ProfilerMiddleware
|
||||
isso = ProfilerMiddleware(isso, sort_by=("cumtime", ), restrictions=("isso/(?!lib)", ))
|
||||
from werkzeug.contrib.profiler import ProfilerMiddleware as Profiler
|
||||
ProfilerMiddleware = lambda app: Profiler(app, sort_by=("cumtime", ), restrictions=("isso/(?!lib)", 10))
|
||||
else:
|
||||
ProfilerMiddleware = lambda app: app
|
||||
|
||||
app = ProxyFix(
|
||||
wsgi.SubURI(
|
||||
wsgi.CORSMiddleware(
|
||||
SharedDataMiddleware(isso, {
|
||||
SharedDataMiddleware(
|
||||
ProfilerMiddleware(isso), {
|
||||
'/js': join(dirname(__file__), 'js/'),
|
||||
'/css': join(dirname(__file__), 'css/')}),
|
||||
list(isso.conf.getiter("general", "host")))))
|
||||
|
Loading…
Reference in New Issue
Block a user