From 97dd3763d3491fa9499fb78078a96eca0bc99b3a Mon Sep 17 00:00:00 2001 From: nadeemshahzad Date: Wed, 23 Jan 2019 14:13:33 +0000 Subject: [PATCH] move program certificates tasks to background_process queue --- lms/envs/aws.py | 3 +++ lms/envs/common.py | 3 +++ lms/envs/production.py | 3 +++ openedx/core/djangoapps/programs/tasks/v1/tasks.py | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lms/envs/aws.py b/lms/envs/aws.py index d828f4d69c..932550d6c2 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -917,6 +917,9 @@ if ENV_TOKENS.get('AUDIT_CERT_CUTOFF_DATE', None): CREDENTIALS_GENERATION_ROUTING_KEY = ENV_TOKENS.get('CREDENTIALS_GENERATION_ROUTING_KEY', DEFAULT_PRIORITY_QUEUE) +# Queue to use for award program certificates +PROGRAM_CERTIFICATES_ROUTING_KEY = ENV_TOKENS.get('PROGRAM_CERTIFICATES_ROUTING_KEY', DEFAULT_PRIORITY_QUEUE) + # The extended StudentModule history table if FEATURES.get('ENABLE_CSMH_EXTENDED'): INSTALLED_APPS.append('coursewarehistoryextended') diff --git a/lms/envs/common.py b/lms/envs/common.py index 28f77bff38..ab47877aad 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -3236,6 +3236,9 @@ AUDIT_CERT_CUTOFF_DATE = None CREDENTIALS_SERVICE_USERNAME = 'credentials_service_user' CREDENTIALS_GENERATION_ROUTING_KEY = DEFAULT_PRIORITY_QUEUE +# Queue to use for award program certificates +PROGRAM_CERTIFICATES_ROUTING_KEY = DEFAULT_PRIORITY_QUEUE + # Settings for Comprehensive Theming app # See https://github.com/edx/edx-django-sites-extensions for more info diff --git a/lms/envs/production.py b/lms/envs/production.py index 4bafbae2b6..92d2b0e125 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -914,6 +914,9 @@ if ENV_TOKENS.get('AUDIT_CERT_CUTOFF_DATE', None): CREDENTIALS_GENERATION_ROUTING_KEY = ENV_TOKENS.get('CREDENTIALS_GENERATION_ROUTING_KEY', DEFAULT_PRIORITY_QUEUE) +# Queue to use for award program certificates +PROGRAM_CERTIFICATES_ROUTING_KEY = ENV_TOKENS.get('PROGRAM_CERTIFICATES_ROUTING_KEY', DEFAULT_PRIORITY_QUEUE) + # The extended StudentModule history table if FEATURES.get('ENABLE_CSMH_EXTENDED'): INSTALLED_APPS.append('coursewarehistoryextended') diff --git a/openedx/core/djangoapps/programs/tasks/v1/tasks.py b/openedx/core/djangoapps/programs/tasks/v1/tasks.py index 5b8fb3e7d0..45e25c8093 100644 --- a/openedx/core/djangoapps/programs/tasks/v1/tasks.py +++ b/openedx/core/djangoapps/programs/tasks/v1/tasks.py @@ -101,7 +101,7 @@ def award_program_certificate(client, username, program_uuid, visible_date): }) -@task(bind=True, ignore_result=True, routing_key=ROUTING_KEY) +@task(bind=True, ignore_result=True, routing_key=settings.PROGRAM_CERTIFICATES_ROUTING_KEY) def award_program_certificates(self, username): """ This task is designed to be called whenever a student's completion status