Don't force modulestore initialization when running lms manage.py, only when running via the wsgi file
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
10
lms/wsgi.py
10
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
|
||||
|
||||
Reference in New Issue
Block a user