Skip to content

Commit

Permalink
feat: when deleting 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 18, 2024
1 parent 8fe50a7 commit 4e2027e
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 @@ -140,7 +140,9 @@ def library_block_deleted(**kwargs) -> None:
log.error("Received null or incorrect data for event")
return

delete_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.
delete_library_block_index_doc.apply(args=[str(library_block_data.usage_key)])


@receiver(CONTENT_LIBRARY_UPDATED)
Expand Down

0 comments on commit 4e2027e

Please sign in to comment.