Skip to content

Commit

Permalink
specify routing / queue for program credentials task.
Browse files Browse the repository at this point in the history
ECOM-3638
  • Loading branch information
jsa committed Feb 12, 2016
1 parent 8a62064 commit 46ad8a3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lms/envs/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,3 +762,7 @@
# Cutoff date for granting audit certificates
if ENV_TOKENS.get('AUDIT_CERT_CUTOFF_DATE', None):
AUDIT_CERT_CUTOFF_DATE = dateutil.parser.parse(ENV_TOKENS.get('AUDIT_CERT_CUTOFF_DATE'))

################################ Settings for Credentials Service ################################

CREDENTIALS_GENERATION_ROUTING_KEY = HIGH_PRIORITY_QUEUE
1 change: 1 addition & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2768,3 +2768,4 @@
################################ Settings for Credentials Service ################################

CREDENTIALS_SERVICE_USERNAME = 'credentials_service_user'
CREDENTIALS_GENERATION_ROUTING_KEY = HIGH_PRIORITY_QUEUE
4 changes: 4 additions & 0 deletions lms/envs/yaml_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,7 @@ def construct_yaml_str(self, node):
if FEATURES.get('ENABLE_LTI_PROVIDER'):
INSTALLED_APPS += ('lti_provider',)
AUTHENTICATION_BACKENDS += ('lti_provider.users.LtiBackend', )

################################ Settings for Credentials Service ################################

CREDENTIALS_GENERATION_ROUTING_KEY = HIGH_PRIORITY_QUEUE
4 changes: 3 additions & 1 deletion openedx/core/djangoapps/programs/tasks/v1/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@


LOGGER = get_task_logger(__name__)
# Under cms the following setting is not defined, leading to errors during tests.
ROUTING_KEY = getattr(settings, 'CREDENTIALS_GENERATION_ROUTING_KEY', None)


def get_api_client(api_config, student):
Expand Down Expand Up @@ -115,7 +117,7 @@ def award_program_certificate(client, username, program_id):
})


@task(bind=True, ignore_result=True)
@task(bind=True, ignore_result=True, routing_key=ROUTING_KEY)
def award_program_certificates(self, username):
"""
This task is designed to be called whenever a student's completion status
Expand Down

0 comments on commit 46ad8a3

Please sign in to comment.