Do not run task system on secondaries.

This commit is contained in:
Luke Sneeringer 2014-12-18 12:14:49 -06:00
parent 50372f9c38
commit 27e8d13790

View File

@ -164,6 +164,10 @@ def rebuild_graph(message):
orphaned running tasks, and creating dependencies for new tasks before
generating directed edge relationships between those tasks.
"""
# Sanity check: Only do this on the primary node.
if Instance.objects.my_role() == 'secondary':
return None
inspector = inspect()
if not hasattr(settings, 'IGNORE_CELERY_INSPECTOR'):
active_task_queues = inspector.active()