Skip to content

Commit 2c6c8cf

Browse files
committed
fix: apply library collection changes synchronously
to update the index before the frontend re-fetches
1 parent ab25e2c commit 2c6c8cf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

openedx/core/djangoapps/content/search/handlers.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,13 @@ def library_collection_updated_handler(**kwargs) -> None:
167167
log.error("Received null or incorrect data for event")
168168
return
169169

170-
update_library_collection_index_doc.delay(
170+
# Update collection index synchronously to make sure that search index is updated before
171+
# the frontend invalidates/refetches index.
172+
# See content_library_updated_handler for more details.
173+
update_library_collection_index_doc.apply(args=[
171174
str(library_collection.library_key),
172175
library_collection.collection_key,
173-
)
176+
])
174177

175178

176179
@receiver(CONTENT_OBJECT_ASSOCIATIONS_CHANGED)

0 commit comments

Comments
 (0)