diff --git a/xmodule/library_tools.py b/xmodule/library_tools.py index 0e3c3af5106..7aa0362ea47 100644 --- a/xmodule/library_tools.py +++ b/xmodule/library_tools.py @@ -128,10 +128,16 @@ def trigger_library_sync(self, dest_block: LibraryContentBlock, library_version: if library_version: raise ObjectDoesNotExist(f"Version {library_version} of library {library_key} not found.") raise ObjectDoesNotExist(f"Library {library_key} not found.") - library_tasks.sync_from_library.delay( - user_id=self.user_id, - dest_block_id=str(dest_block.scope_ids.usage_id), - library_version=library_version, + + # TODO: This task is synchronous until we can figure out race conditions with import. + # These race conditions lead to failed imports of library content from course import. + # See: TNL-11339, https://github.com/openedx/edx-platform/issues/34029 for more info. + library_tasks.sync_from_library.apply( + kwargs=dict( + user_id=self.user_id, + dest_block_id=str(dest_block.scope_ids.usage_id), + library_version=library_version, + ), ) def trigger_duplication(self, source_block: LibraryContentBlock, dest_block: LibraryContentBlock) -> None: