Skip to content

Commit e0182f6

Browse files
docs: brief comment added on why we added this copy()
1 parent 598c55a commit e0182f6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

xmodule/modulestore/split_mongo/split.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3283,6 +3283,10 @@ def create_runtime(self, course_entry, lazy):
32833283
"""
32843284
Create the proper runtime for this course
32853285
"""
3286+
# A single SplitMongoModuleStore may create many SplitModuleStoreRuntimes,
3287+
# each of which will later modify its internal dict of services on a per-item and often per-user basis.
3288+
# Therefore, it's critical that we make a new copy of our baseline services dict here,
3289+
# so that each runtime is free to add and replace its services without impacting other runtimes.
32863290
services = self.services.copy()
32873291
# Only the CourseBlock can have user partitions. Therefore, creating the PartitionService with the library key
32883292
# instead of the course key does not work. The XBlock validation in Studio fails with the following message:

0 commit comments

Comments
 (0)