From 7abe1ec3648715d0f7c31939f44cc2c8dded2261 Mon Sep 17 00:00:00 2001 From: Javier Torres Date: Mon, 4 Dec 2023 14:21:26 -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 20c14089e0a6..53b09019d644 100644 --- a/cms/djangoapps/contentstore/signals/handlers.py +++ b/cms/djangoapps/contentstore/signals/handlers.py @@ -133,7 +133,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.