From 51d0dd121da3fe9b8bb45db97e796813a2906d2f Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Wed, 25 Sep 2013 16:02:08 -0400 Subject: [PATCH] LMS startup needs to initialize the modulestores so that we don't lazy load all of the XML courses on first HTTP request --- lms/startup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lms/startup.py b/lms/startup.py index 7b51151ca7..6837383130 100644 --- a/lms/startup.py +++ b/lms/startup.py @@ -9,6 +9,7 @@ from django.conf import settings settings.INSTALLED_APPS # pylint: disable=W0104 from django_startup import autostartup +from xmodule.modulestore.django import modulestore log = logging.getLogger(__name__) @@ -17,3 +18,8 @@ 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 + for store_name in settings.MODULESTORE: + modulestore(store_name)