From a78db97d262b04e601b2b40c1e3ce589e906616a Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 30 Jan 2017 10:50:56 -0500 Subject: [PATCH] Delay grades recalculation task As discovered in load testing, if this task is run too quickly it can ask for a newly-recorded score prior to the active transaction finishing and writing to the database. TNL-6424 --- lms/djangoapps/grades/signals/handlers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/grades/signals/handlers.py b/lms/djangoapps/grades/signals/handlers.py index 4c66bdb848..cdbe957f4e 100644 --- a/lms/djangoapps/grades/signals/handlers.py +++ b/lms/djangoapps/grades/signals/handlers.py @@ -191,7 +191,8 @@ def enqueue_subsection_update(sender, **kwargs): # pylint: disable=unused-argum event_transaction_id=unicode(get_event_transaction_id()), event_transaction_type=unicode(get_event_transaction_type()), score_db_table=kwargs['score_db_table'], - ) + ), + countdown=2, ) log.info( u'Grades: Request async calculation of subsection grades with args: {}. Task [{}]'.format(