mirror of
https://github.com/ansible/awx.git
synced 2026-02-12 07:04:45 -03:30
If database connectivity is lost/interrupted in this block of celery internals, beat is *not* smart enough to recover, and it gets stuck in an endless fail loop. We don't _need_ to talk to the database here anyways; just use settings.CLUSTER_HOST_ID to get what we need. see: https://github.com/ansible/tower/issues/2957
18 lines
530 B
Python
18 lines
530 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
# Copyright (c) 2017 Ansible Tower by Red Hat
|
|
# All Rights Reserved.
|
|
|
|
from django.conf import settings
|
|
|
|
|
|
class AWXCeleryRouter(object):
|
|
def route_for_task(self, task, args=None, kwargs=None):
|
|
tasks = [
|
|
'awx.main.tasks.cluster_node_heartbeat',
|
|
'awx.main.tasks.purge_old_stdout_files',
|
|
'awx.main.tasks.awx_isolated_heartbeat',
|
|
]
|
|
if task in tasks:
|
|
return {'queue': settings.CLUSTER_HOST_ID, 'routing_key': settings.CLUSTER_HOST_ID}
|