Commit a42a6455 by Eric Fischer Committed by GitHub

Merge pull request #14061 from edx/efischer/celery_logging

Add logging around problematically queued task
parents 6cdb4170 f69b2c41
......@@ -5,6 +5,9 @@ For more, see http://celery.readthedocs.io/en/latest/userguide/routing.html#rout
"""
from abc import ABCMeta, abstractproperty
from django.conf import settings
import logging
log = logging.getLogger(__name__)
class AlternateEnvironmentRouter(object):
......@@ -30,6 +33,13 @@ class AlternateEnvironmentRouter(object):
If None is returned from this method, default routing logic is used.
"""
alternate_env = self.alternate_env_tasks.get(task, None)
if 'update_course_in_cache' in task:
log.info("TNL-5408: task={task}, args={args}, alternate_env={alt_env}, queues={queues}".format(
task=task,
args=args,
alt_env=alternate_env,
queues=getattr(settings, 'CELERY_QUEUES', []).keys()
))
if alternate_env:
return self.ensure_queue_env(alternate_env)
return None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment