From c6b2984141f4957c8bb58c6d0e609b71a34c3b27 Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Fri, 11 May 2018 10:39:47 -0400 Subject: [PATCH] WSGI: Move the application creation within the app method Otherwise the application is likely ever loaded once instead of being put back into the context every time. Change-Id: I686bea29bc4f6e2450dcc47e94640ace6f73dcc6 --- ara/wsgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ara/wsgi.py b/ara/wsgi.py index 1c2188d6..b4b4bf8b 100644 --- a/ara/wsgi.py +++ b/ara/wsgi.py @@ -50,7 +50,6 @@ from ara.webapp import create_app # flake8: noqa from flask import current_app # flake8: noqa log = logging.getLogger(__name__) -app = create_app() def application(environ, start_response): @@ -60,6 +59,7 @@ def application(environ, start_response): if 'ANSIBLE_CONFIG' not in os.environ: log.warn('ANSIBLE_CONFIG environment variable not found.') + app = create_app() if not current_app: ctx = app.app_context() ctx.push()