From d5240626528547e112c78af633c1f4494a5c6d91 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 27 Aug 2012 17:47:37 -0400 Subject: [PATCH 1/2] Put quick check so we don't load course modules on init unless we're actually running in Django --- common/lib/xmodule/xmodule/modulestore/django.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/modulestore/django.py b/common/lib/xmodule/xmodule/modulestore/django.py index 59668b4a5a..d46422cbf1 100644 --- a/common/lib/xmodule/xmodule/modulestore/django.py +++ b/common/lib/xmodule/xmodule/modulestore/django.py @@ -5,8 +5,8 @@ Passes settings.MODULESTORE as kwargs to MongoModuleStore """ from __future__ import absolute_import - from importlib import import_module +from os import environ from django.conf import settings @@ -44,6 +44,7 @@ def modulestore(name='default'): return _MODULESTORES[name] -# Initialize the modulestores immediately -for store_name in settings.MODULESTORE: - modulestore(store_name) +if 'DJANGO_SETTINGS_MODULE' in environ: + # Initialize the modulestores immediately + for store_name in settings.MODULESTORE: + modulestore(store_name) From 57c6bfc3a6239e91caaf2237b98deb862127e27e Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 27 Aug 2012 18:46:13 -0400 Subject: [PATCH 2/2] commenting out the pre-loading of modules until we get a better way in place (that doesn't hang on deploy) --- common/lib/xmodule/xmodule/modulestore/django.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/modulestore/django.py b/common/lib/xmodule/xmodule/modulestore/django.py index d46422cbf1..0b86c2fea4 100644 --- a/common/lib/xmodule/xmodule/modulestore/django.py +++ b/common/lib/xmodule/xmodule/modulestore/django.py @@ -44,7 +44,7 @@ def modulestore(name='default'): return _MODULESTORES[name] -if 'DJANGO_SETTINGS_MODULE' in environ: - # Initialize the modulestores immediately - for store_name in settings.MODULESTORE: - modulestore(store_name) +# if 'DJANGO_SETTINGS_MODULE' in environ: +# # Initialize the modulestores immediately +# for store_name in settings.MODULESTORE: +# modulestore(store_name)