Revert "Revert ""Update routing config" (#25536)" (#25549)" (#25553)

This reverts commit c1fe3c3a93.
This commit is contained in:
Awais Qureshi
2020-11-10 23:23:09 +05:00
committed by GitHub
parent 0f6d94d1af
commit db4c3b1210
20 changed files with 145 additions and 138 deletions

View File

@@ -246,7 +246,7 @@ def should_dump_course(course_key, graph):
return last_this_command_was_run < course_last_published_date
@task(routing_key=settings.COURSEGRAPH_JOB_QUEUE)
@task
def dump_course_to_neo4j(course_key_string, credentials):
"""
Serializes a course and writes it to neo4j.

View File

@@ -13,11 +13,6 @@ from openedx.core.djangoapps.credentials.utils import get_credentials_api_client
logger = get_task_logger(__name__)
# Under cms the following setting is not defined, leading to errors during tests.
# These tasks aren't strictly credentials generation, but are similar in the sense
# that they generate records on the credentials side. And have a similar SLA.
ROUTING_KEY = getattr(settings, 'CREDENTIALS_GENERATION_ROUTING_KEY', None)
# Maximum number of retries before giving up.
# For reference, 11 retries with exponential backoff yields a maximum waiting
# time of 2047 seconds (about 30 minutes). Setting this to None could yield
@@ -25,7 +20,7 @@ ROUTING_KEY = getattr(settings, 'CREDENTIALS_GENERATION_ROUTING_KEY', None)
MAX_RETRIES = 11
@task(bind=True, ignore_result=True, routing_key=ROUTING_KEY)
@task(bind=True, ignore_result=True)
def send_grade_to_credentials(self, username, course_run_key, verified, letter_grade, percent_grade):
""" Celery task to notify the Credentials IDA of a grade change via POST. """
logger.info(u'Running task send_grade_to_credentials for username %s and course %s', username, course_run_key)

View File

@@ -4,9 +4,8 @@ A trivial task for health checks
from celery.task import task
from django.conf import settings
@task(routing_key=settings.HEARTBEAT_CELERY_ROUTING_KEY)
@task
def sample_task():
return True

View File

@@ -22,9 +22,6 @@ from openedx.core.djangoapps.programs.utils import ProgramProgressMeter
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
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)
PROGRAM_CERTIFICATES_ROUTING_KEY = getattr(settings, 'PROGRAM_CERTIFICATES_ROUTING_KEY', None)
# Maximum number of retries before giving up on awarding credentials.
# For reference, 11 retries with exponential backoff yields a maximum waiting
# time of 2047 seconds (about 30 minutes). Setting this to None could yield
@@ -123,7 +120,7 @@ def award_program_certificate(client, username, program_uuid, visible_date):
})
@task(bind=True, ignore_result=True, routing_key=PROGRAM_CERTIFICATES_ROUTING_KEY)
@task(bind=True, ignore_result=True)
def award_program_certificates(self, username):
"""
This task is designed to be called whenever a student's completion status
@@ -285,7 +282,7 @@ def post_course_certificate(client, username, certificate, visible_date):
})
@task(bind=True, ignore_result=True, routing_key=ROUTING_KEY)
@task(bind=True, ignore_result=True)
def award_course_certificate(self, username, course_run_key):
"""
This task is designed to be called whenever a student GeneratedCertificate is updated.
@@ -399,7 +396,7 @@ def revoke_program_certificate(client, username, program_uuid):
})
@task(bind=True, ignore_result=True, routing_key=PROGRAM_CERTIFICATES_ROUTING_KEY)
@task(bind=True, ignore_result=True)
def revoke_program_certificates(self, username, course_key):
"""
This task is designed to be called whenever a student's course certificate is
@@ -522,7 +519,7 @@ def revoke_program_certificates(self, username, course_key):
LOGGER.info(u'Successfully completed the task revoke_program_certificates for username %s', username)
@task(bind=True, ignore_result=True, routing_key=PROGRAM_CERTIFICATES_ROUTING_KEY)
@task(bind=True, ignore_result=True)
def update_certificate_visible_date_on_course_update(self, course_key):
"""
This task is designed to be called whenever a course is updated with

View File

@@ -143,7 +143,7 @@ class BinnedScheduleMessageBaseTask(ScheduleMessageBaseTask):
raise NotImplementedError
@task(base=LoggedTask, ignore_result=True, routing_key=ROUTING_KEY)
@task(base=LoggedTask, ignore_result=True)
def _recurring_nudge_schedule_send(site_id, msg_str):
_schedule_send(
msg_str,
@@ -153,7 +153,7 @@ def _recurring_nudge_schedule_send(site_id, msg_str):
)
@task(base=LoggedTask, ignore_result=True, routing_key=ROUTING_KEY)
@task(base=LoggedTask, ignore_result=True)
def _upgrade_reminder_schedule_send(site_id, msg_str):
_schedule_send(
msg_str,
@@ -163,7 +163,7 @@ def _upgrade_reminder_schedule_send(site_id, msg_str):
)
@task(base=LoggedTask, ignore_result=True, routing_key=ROUTING_KEY)
@task(base=LoggedTask, ignore_result=True)
def _course_update_schedule_send(site_id, msg_str):
_schedule_send(
msg_str,