Commit 818ad159 by Calen Pennington

Merge pull request #2304 from cpennington/less-initialization

Don't force modulestore initialization when running lms manage.py, only when running via the wsgi file
parents bf147e00 13c894eb
......@@ -409,10 +409,6 @@ DOC_STORE_CONFIG = {
'collection': 'modulestore',
}
# Should we initialize the modulestores at startup, or wait until they are
# needed?
INIT_MODULESTORE_ON_STARTUP = True
############# XBlock Configuration ##########
# This should be moved into an XBlock Runtime/Application object
......
......@@ -114,10 +114,6 @@ MODULESTORE = {
}
}
# Starting modulestores generates log messages. If we wait to init modulestores,
# then those messages will be silenced by the test runner.
INIT_MODULESTORE_ON_STARTUP = False
CONTENTSTORE = {
'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore',
'DOC_STORE_CONFIG': {
......
......@@ -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()
......
......@@ -5,6 +5,15 @@ 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.
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment