Minimize the number of roundtrips to mongo during cms save by prefetching children

This commit is contained in:
Calen Pennington
2012-07-11 16:22:24 -04:00
parent efc85b0483
commit f8e9313dad
4 changed files with 92 additions and 23 deletions

View File

@@ -54,7 +54,7 @@ def save_item(request):
# This uses wildcarding to find the course, which requires handling
# multiple courses returned, but there should only ever be one
course_location = Location(item_id)._replace(category='course', name=None)
courses = modulestore().get_items(course_location)
courses = modulestore().get_items(course_location, depth=None)
for course in courses:
export_to_github(course, "CMS Edit")