Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
23cb5499
Commit
23cb5499
authored
Jul 18, 2014
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4477 from edx/studio/minimal-fix-import-performance
Studio/minimal fix import performance
parents
c2565396
a501aa94
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
common/lib/xmodule/xmodule/modulestore/mixed.py
+2
-2
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+12
-2
No files found.
common/lib/xmodule/xmodule/modulestore/mixed.py
View file @
23cb5499
...
...
@@ -497,8 +497,8 @@ def store_bulk_write_operations_on_course(store, course_id):
# request comes in for the same course.
# if the caller passed in the mixed modulestore, get a direct pointer to the underlying store
if
hasattr
(
store
,
'_get_modulestore_
by_course_
id'
):
store
=
store
.
_get_modulestore_
by_course_
id
(
course_id
)
if
hasattr
(
store
,
'_get_modulestore_
for_course
id'
):
store
=
store
.
_get_modulestore_
for_course
id
(
course_id
)
try
:
if
hasattr
(
store
,
'begin_bulk_write_operation_on_course'
):
...
...
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
23cb5499
...
...
@@ -405,6 +405,13 @@ class MongoModuleStore(ModuleStoreWriteBase):
self
.
ignore_write_events_on_courses
.
remove
(
course_id
)
self
.
refresh_cached_metadata_inheritance_tree
(
course_id
)
def
_is_bulk_write_in_progress
(
self
,
course_id
):
"""
Returns whether a bulk write operation is in progress for the given course.
"""
# check with branch set to None
return
course_id
in
self
.
ignore_write_events_on_courses
def
_fill_in_run
(
self
,
course_key
):
if
course_key
.
run
is
not
None
:
return
course_key
...
...
@@ -552,7 +559,7 @@ class MongoModuleStore(ModuleStoreWriteBase):
If given a runtime, it replaces the cached_metadata in that runtime. NOTE: failure to provide
a runtime may mean that some objects report old values for inherited data.
"""
if
course_id
not
in
self
.
ignore_write_events_on_courses
:
if
not
self
.
_is_bulk_write_in_progress
(
course_id
)
:
# below is done for side effects when runtime is None
cached_metadata
=
self
.
_get_cached_metadata_inheritance_tree
(
course_id
,
force_refresh
=
True
)
if
runtime
:
...
...
@@ -1033,7 +1040,10 @@ class MongoModuleStore(ModuleStoreWriteBase):
# update subtree edited info for ancestors
# don't update the subtree info for descendants of the publish root for efficiency
if
(
not
isPublish
)
or
(
isPublish
and
is_publish_root
):
if
(
(
not
isPublish
or
(
isPublish
and
is_publish_root
))
and
not
self
.
_is_bulk_write_in_progress
(
xblock
.
location
.
course_key
)
):
ancestor_payload
=
{
'edit_info.subtree_edited_on'
:
now
,
'edit_info.subtree_edited_by'
:
user_id
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment