Files
edx-platform/lms/startup.py
Ned Batchelder 50aa37be57 Quiet down exceptions at startup, and during tests
There's no need to display a traceback for every failed content load,
the comment before the log line even says so.

The exceptions shown before tests are run are because of the eager
initialization of the modulestores.  They don't need to be initialized
then, that just speeds the responsiveness of servers.  Putting off the
initialization means they get inited as needed, and the log lines get
2013-10-01 18:13:06 -04:00

27 lines
716 B
Python

"""
Module for code that should run during LMS startup
"""
import logging
from django.conf import settings
# Force settings to run so that the python path is modified
settings.INSTALLED_APPS # pylint: disable=W0104
from django_startup import autostartup
from xmodule.modulestore.django import modulestore
log = logging.getLogger(__name__)
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)