From f6c041935716c20a72baca8cdbae0816a8c86541 Mon Sep 17 00:00:00 2001 From: Javier Torres Date: Fri, 1 Dec 2023 15:08:49 -0500 Subject: [PATCH] fix: delay update_outline_from_modulestore_task after course publish. --- cms/djangoapps/contentstore/signals/handlers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/signals/handlers.py b/cms/djangoapps/contentstore/signals/handlers.py index 76711eaa4ddc..c36d72aab163 100644 --- a/cms/djangoapps/contentstore/signals/handlers.py +++ b/cms/djangoapps/contentstore/signals/handlers.py @@ -134,7 +134,10 @@ def listen_for_course_publish(sender, course_key, **kwargs): # pylint: disable= if key_supports_outlines(course_key): # Push the course outline to learning_sequences asynchronously. - update_outline_from_modulestore_task.delay(course_key_str) + update_outline_from_modulestore_task.apply_async( + args=[course_key_str], + countdown=settings.BLOCK_STRUCTURES_SETTINGS.get('COURSE_PUBLISH_TASK_DELAY', 30), + ) if settings.COURSEGRAPH_DUMP_COURSE_ON_PUBLISH: # Push the course out to CourseGraph asynchronously.