From 1533623a0da1218946f8aa676bcb3ce869909278 Mon Sep 17 00:00:00 2001 From: Joseph Mulloy Date: Tue, 2 Oct 2018 13:26:40 -0400 Subject: [PATCH] Move tasks to low priority queue from default --- lms/djangoapps/bulk_email/tasks.py | 2 +- lms/djangoapps/instructor_task/tasks.py | 2 +- openedx/core/djangoapps/content/block_structure/tasks.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/bulk_email/tasks.py b/lms/djangoapps/bulk_email/tasks.py index ad9390ebca..dd1e0c4cd5 100644 --- a/lms/djangoapps/bulk_email/tasks.py +++ b/lms/djangoapps/bulk_email/tasks.py @@ -238,7 +238,7 @@ def perform_delegate_email_batches(entry_id, course_id, task_input, action_name) return progress -@task(default_retry_delay=settings.BULK_EMAIL_DEFAULT_RETRY_DELAY, max_retries=settings.BULK_EMAIL_MAX_RETRIES) +@task(default_retry_delay=settings.BULK_EMAIL_DEFAULT_RETRY_DELAY, max_retries=settings.BULK_EMAIL_MAX_RETRIES, routing_key=settings.LOW_PRIORITY_QUEUE) def send_course_email(entry_id, email_id, to_list, global_email_context, subtask_status_dict): """ Sends an email to a list of recipients. diff --git a/lms/djangoapps/instructor_task/tasks.py b/lms/djangoapps/instructor_task/tasks.py index 78d826f26e..a325e7b041 100644 --- a/lms/djangoapps/instructor_task/tasks.py +++ b/lms/djangoapps/instructor_task/tasks.py @@ -138,7 +138,7 @@ def delete_problem_state(entry_id, xmodule_instance_args): return run_main_task(entry_id, visit_fcn, action_name) -@task(base=BaseInstructorTask) +@task(base=BaseInstructorTask, routing_key=settings.LOW_PRIORITY_QUEUE) def send_bulk_course_email(entry_id, _xmodule_instance_args): """Sends emails to recipients enrolled in a course. diff --git a/openedx/core/djangoapps/content/block_structure/tasks.py b/openedx/core/djangoapps/content/block_structure/tasks.py index c97d0bf700..740950bc17 100644 --- a/openedx/core/djangoapps/content/block_structure/tasks.py +++ b/openedx/core/djangoapps/content/block_structure/tasks.py @@ -30,6 +30,7 @@ def block_structure_task(**kwargs): default_retry_delay=settings.BLOCK_STRUCTURES_SETTINGS['TASK_DEFAULT_RETRY_DELAY'], max_retries=settings.BLOCK_STRUCTURES_SETTINGS['TASK_MAX_RETRIES'], bind=True, + routing_key=settings.LOW_PRIORITY_QUEUE, **kwargs )