Skip to content

Commit

Permalink
docs: fixing race condition comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Mar 19, 2024
1 parent 1cbbc18 commit e0f2051
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions openedx/core/djangoapps/content/search/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ def upsert_xblock_index_doc(
update_tags (bool): If True, update the tags of the XBlock
"""
# If there is a rebuild in progress, wait for it to finish
# This could still be a problem if a rebuild starts right after this check, but we don't want to prevent
# concurrent updates entirely.
# If a rebuild starts right after this check, it will already have the updated data, so this is not a problem.
_wait_index_rebuild_lock(INDEX_NAME)

course = modulestore().get_item(usage_key)
Expand All @@ -319,8 +318,7 @@ def delete_xblock_index_doc(usage_key: UsageKey) -> None:
Deletes the document for the given XBlock from the search index
"""
# If there is a rebuild in progress, wait for it to finish
# This could still be a problem if a rebuild starts right after this check, but we don't want to prevent
# concurrent updates entirely.
# If a rebuild starts right after this check, it will already have the updated data, so this is not a problem.
_wait_index_rebuild_lock(INDEX_NAME)

client = _get_meilisearch_client()
Expand Down

0 comments on commit e0f2051

Please sign in to comment.