Skip to content

Commit

Permalink
WSGI: Move the application creation within the app method
Browse files Browse the repository at this point in the history
Otherwise the application is likely ever loaded once instead of being
put back into the context every time.

Change-Id: I686bea29bc4f6e2450dcc47e94640ace6f73dcc6
  • Loading branch information
David Moreau Simard committed Jun 1, 2018
1 parent 513382d commit c6b2984
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ara/wsgi.py
Expand Up @@ -50,7 +50,6 @@
from flask import current_app # flake8: noqa

log = logging.getLogger(__name__)
app = create_app()


def application(environ, start_response):
Expand All @@ -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()
Expand Down

0 comments on commit c6b2984

Please sign in to comment.