mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 23:17:32 -02:30
remove support for multi-reader dispatch queue
* Under the new postgres backed notify/listen message queue, this never actually worked. Without using the database to store state, we can not provide a at-most-once delivery mechanism w/ multi-readers. * With this change, work is done ONLY on the node that requested for the work to be done. Under rabbitmq, the node that was first to get the message off the queue would do the work; presumably the least busy node.
This commit is contained in:
committed by
Ryan Petrello
parent
50b56aa8cb
commit
dc6c353ecd
@@ -8,7 +8,7 @@ from uuid import uuid4
|
||||
from django.conf import settings
|
||||
from django.db import connection
|
||||
|
||||
from . import pg_bus_conn
|
||||
from . import pg_bus_conn, get_local_queuename
|
||||
|
||||
logger = logging.getLogger('awx.main.dispatch')
|
||||
|
||||
@@ -73,9 +73,12 @@ class task:
|
||||
kwargs = kwargs or {}
|
||||
queue = (
|
||||
queue or
|
||||
getattr(cls.queue, 'im_func', cls.queue) or
|
||||
settings.CELERY_DEFAULT_QUEUE
|
||||
getattr(cls.queue, 'im_func', cls.queue)
|
||||
)
|
||||
if not queue:
|
||||
msg = f'{cls.name}: Queue value required and may not me None'
|
||||
logger.error(msg)
|
||||
raise ValueError(msg)
|
||||
obj = {
|
||||
'uuid': task_id,
|
||||
'args': args,
|
||||
|
||||
Reference in New Issue
Block a user