Skip to content

Commit

Permalink
feat: when changing a v2 library block, update search index synchrono…
Browse files Browse the repository at this point in the history
…usly
  • Loading branch information
bradenmacdonald committed Sep 17, 2024
1 parent 5927be7 commit 8fe50a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openedx/core/djangoapps/content/search/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ def library_block_updated_handler(**kwargs) -> None:
log.error("Received null or incorrect data for event")
return

upsert_library_block_index_doc.delay(str(library_block_data.usage_key))
# Update content library index synchronously to make sure that search index is updated before
# the frontend invalidates/refetches results. This is only a single document update so is very fast.
upsert_library_block_index_doc.apply(args=[str(library_block_data.usage_key)])


@receiver(LIBRARY_BLOCK_DELETED)
Expand Down

0 comments on commit 8fe50a7

Please sign in to comment.