From eeae57597d7790c44f7c20faf022a56ed24723de Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Fri, 13 Nov 2020 13:46:48 -0500 Subject: [PATCH] Run subsection completion milestones task async. This function is a celery task but it seems like it is not being called correctly. The way it was, it would run in process. We update the call so that it is called asynchronously as a celery task instead. This may have some user facing impact as the work might now take longer to do than when it was running in the request process. However leaving it as is, definitely makes the user experience slower causes us to do computationally intensive work in the web request. It also makes it much harder to monitor as our ownership assignment tracking for the feature does not work correctly. --- lms/djangoapps/gating/signals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/djangoapps/gating/signals.py b/lms/djangoapps/gating/signals.py index a99e5c5180..292cf1c8ec 100644 --- a/lms/djangoapps/gating/signals.py +++ b/lms/djangoapps/gating/signals.py @@ -42,7 +42,7 @@ def evaluate_subsection_completion_milestones(**kwargs): return # Content in a library or some other thing that doesn't support milestones block_id = six.text_type(instance.block_key) user_id = instance.user_id - task_evaluate_subsection_completion_milestones(course_id, block_id, user_id) + task_evaluate_subsection_completion_milestones.delay(course_id, block_id, user_id) @receiver(COURSE_GRADE_CHANGED)