Sfoglia il codice sorgente

Adapt profiler script to multi-modal access.

Stefano Cossu 6 anni fa
parent
commit
8554f845a3
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 9 1
      profiler.py

+ 9 - 1
profiler.py

@@ -1,15 +1,23 @@
 #!/usr/bin/env python
 
+import logging
+from logging.config import dictConfig
 from werkzeug.contrib.profiler import ProfilerMiddleware
 
-from lakesuperior.app import create_app
+# Environment must be set before importing the app factory function.
+import lakesuperior.env_setup
+
 from lakesuperior.config_parser import config
+from lakesuperior.globals import AppGlobals
+from lakesuperior.env import env
 
 options = {
     'restrictions': [30],
     #'profile_dir': '/tmp/lsup_profiling'
 }
 
+from lakesuperior.app import create_app
+
 if __name__ == '__main__':
     fcrepo = create_app(config['application'])
     fcrepo.wsgi_app = ProfilerMiddleware(fcrepo.wsgi_app, **options)