Skip to content

Commit

Permalink
fix: apply library collection changes synchronously
Browse files Browse the repository at this point in the history
to update the index before the frontend re-fetches
  • Loading branch information
pomegranited committed Sep 12, 2024
1 parent ab25e2c commit 2c6c8cf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openedx/core/djangoapps/content/search/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,13 @@ def library_collection_updated_handler(**kwargs) -> None:
log.error("Received null or incorrect data for event")
return

update_library_collection_index_doc.delay(
# Update collection index synchronously to make sure that search index is updated before
# the frontend invalidates/refetches index.
# See content_library_updated_handler for more details.
update_library_collection_index_doc.apply(args=[
str(library_collection.library_key),
library_collection.collection_key,
)
])


@receiver(CONTENT_OBJECT_ASSOCIATIONS_CHANGED)
Expand Down

0 comments on commit 2c6c8cf

Please sign in to comment.