diff --git a/common/djangoapps/student/tasks.py b/common/djangoapps/student/tasks.py index 23b9481c30..5f50090ef1 100644 --- a/common/djangoapps/student/tasks.py +++ b/common/djangoapps/student/tasks.py @@ -12,7 +12,7 @@ from django.core import mail log = logging.getLogger('edx.celery.task') -@task(bind=True) +@task(bind=True, routing_key=settings.LOW_PRIORITY_QUEUE) def send_activation_email(self, subject, message, from_address, dest_addr): """ Sending an activation email to the user. diff --git a/lms/djangoapps/certificates/tasks.py b/lms/djangoapps/certificates/tasks.py index 380b1e630f..8b2b90cddc 100644 --- a/lms/djangoapps/certificates/tasks.py +++ b/lms/djangoapps/certificates/tasks.py @@ -7,11 +7,12 @@ from lms.djangoapps.verify_student.services import IDVerificationService from opaque_keys.edx.keys import CourseKey from .api import generate_user_certificates +from django.conf import settings logger = getLogger(__name__) -@task(base=LoggedPersistOnFailureTask, bind=True, default_retry_delay=30, max_retries=2) +@task(base=LoggedPersistOnFailureTask, bind=True, default_retry_delay=30, max_retries=2, routing_key=settings.LOW_PRIORITY_QUEUE) def generate_certificate(self, **kwargs): """ Generates a certificate for a single user. diff --git a/openedx/core/djangoapps/verified_track_content/tasks.py b/openedx/core/djangoapps/verified_track_content/tasks.py index 82bc8cef02..5a79f8eab7 100644 --- a/openedx/core/djangoapps/verified_track_content/tasks.py +++ b/openedx/core/djangoapps/verified_track_content/tasks.py @@ -8,11 +8,12 @@ from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.course_groups.cohorts import add_user_to_cohort, get_cohort, get_cohort_by_name from student.models import CourseEnrollment, CourseMode +from django.conf import settings LOGGER = get_task_logger(__name__) -@task(bind=True, default_retry_delay=60, max_retries=2) +@task(bind=True, default_retry_delay=60, max_retries=2, routing_key=settings.LOW_PRIORITY_QUEUE) def sync_cohort_with_mode(self, course_id, user_id, verified_cohort_name, default_cohort_name): """ If the learner's mode does not match their assigned cohort, move the learner into the correct cohort.