Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
0d3c18df
Commit
0d3c18df
authored
11 years ago
by
Ned Batchelder
Browse files
Options
Downloads
Plain Diff
Merge pull request #2069 from edx/ned/minor-startup-fixes
Very Minor tweaks to the LMS and CMS startup.
parents
1c979090
39380f2d
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cms/startup.py
+0
-2
0 additions, 2 deletions
cms/startup.py
common/lib/django_startup.py
+9
-2
9 additions, 2 deletions
common/lib/django_startup.py
lms/startup.py
+2
-4
2 additions, 4 deletions
lms/startup.py
with
11 additions
and
8 deletions
cms/startup.py
+
0
−
2
View file @
0d3c18df
"""
Module with code executed during Studio startup
"""
import
logging
from
django.conf
import
settings
# Force settings to run so that the python path is modified
...
...
@@ -9,7 +8,6 @@ settings.INSTALLED_APPS # pylint: disable=W0104
from
django_startup
import
autostartup
log
=
logging
.
getLogger
(
__name__
)
# TODO: Remove this code once Studio/CMS runs via wsgi in all environments
INITIALIZED
=
False
...
...
This diff is collapsed.
Click to expand it.
common/lib/django_startup.py
+
9
−
2
View file @
0d3c18df
"""
Automatic execution of startup modules in Django apps.
"""
from
importlib
import
import_module
from
django.conf
import
settings
...
...
@@ -6,9 +10,12 @@ def autostartup():
Execute app.startup:run() for all installed django apps
"""
for
app
in
settings
.
INSTALLED_APPS
:
# See if there's a startup module in each app.
try
:
mod
=
import_module
(
app
+
'
.startup
'
)
if
hasattr
(
mod
,
'
run
'
):
mod
.
run
()
except
ImportError
:
continue
# If the module has a run method, run it.
if
hasattr
(
mod
,
'
run
'
):
mod
.
run
()
This diff is collapsed.
Click to expand it.
lms/startup.py
+
2
−
4
View file @
0d3c18df
"""
Module for code that should run during LMS startup
"""
import
logging
from
django.conf
import
settings
...
...
@@ -11,7 +10,6 @@ settings.INSTALLED_APPS # pylint: disable=W0104
from
django_startup
import
autostartup
from
xmodule.modulestore.django
import
modulestore
log
=
logging
.
getLogger
(
__name__
)
def
run
():
"""
...
...
@@ -19,8 +17,8 @@ def run():
"""
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.
# 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 diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment