From 7c758ec982571d4eb8a18b86dfa4cf402f4beb32 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 24 Jan 2014 12:42:08 -0500 Subject: [PATCH] Don't force modulestore initialization when running lms manage.py, only when running via the wsgi file --- lms/startup.py | 8 +------- lms/wsgi.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lms/startup.py b/lms/startup.py index 2021db8e64..c0c95bbf89 100644 --- a/lms/startup.py +++ b/lms/startup.py @@ -8,21 +8,15 @@ from django.conf import settings settings.INSTALLED_APPS # pylint: disable=W0104 from django_startup import autostartup -from xmodule.modulestore.django import modulestore import edxmako + def run(): """ Executed during django startup """ autostartup() - # Trigger a forced initialization of our modulestores since this can take a - # while to complete and we want this done before HTTP requests are accepted. - if settings.INIT_MODULESTORE_ON_STARTUP: - for store_name in settings.MODULESTORE: - modulestore(store_name) - if settings.FEATURES.get('USE_CUSTOM_THEME', False): enable_theme() diff --git a/lms/wsgi.py b/lms/wsgi.py index 683ef46892..2f384e1413 100644 --- a/lms/wsgi.py +++ b/lms/wsgi.py @@ -5,6 +5,16 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.envs.aws") import lms.startup as startup startup.run() +from django.conf import settings +from xmodule.modulestore.django import modulestore + +# Trigger a forced initialization of our modulestores since this can take a +# while to complete and we want this done before HTTP requests are accepted. +if settings.INIT_MODULESTORE_ON_STARTUP: + for store_name in settings.MODULESTORE: + modulestore(store_name) + + # This application object is used by the development server # as well as any WSGI server configured to use this file. from django.core.wsgi import get_wsgi_application