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