This reverts commit 39a22734c1.
This commit is contained in:
committed by
GitHub
parent
e5e3fcdc1c
commit
c1fe3c3a93
@@ -5,11 +5,13 @@ This file contains celery tasks for entitlements-related functionality.
|
||||
|
||||
from celery import task
|
||||
from celery.utils.log import get_task_logger
|
||||
from django.conf import settings
|
||||
|
||||
from entitlements.models import CourseEntitlement
|
||||
|
||||
LOGGER = get_task_logger(__name__)
|
||||
|
||||
# Under cms the following setting is not defined, leading to errors during tests.
|
||||
ROUTING_KEY = getattr(settings, 'ENTITLEMENTS_EXPIRATION_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
|
||||
@@ -17,7 +19,7 @@ LOGGER = get_task_logger(__name__)
|
||||
MAX_RETRIES = 11
|
||||
|
||||
|
||||
@task(bind=True, ignore_result=True)
|
||||
@task(bind=True, ignore_result=True, routing_key=ROUTING_KEY)
|
||||
def expire_old_entitlements(self, start, end, logid='...'):
|
||||
"""
|
||||
This task is designed to be called to process a bundle of entitlements
|
||||
|
||||
Reference in New Issue
Block a user