mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
Fix a bug where a socket would re-emit its message 3 extra times
This commit is contained in:
@@ -103,7 +103,7 @@ class Socket(object):
|
|||||||
self._socket.close()
|
self._socket.close()
|
||||||
self._socket = None
|
self._socket = None
|
||||||
self._context = None
|
self._context = None
|
||||||
|
|
||||||
def publish(self, message):
|
def publish(self, message):
|
||||||
"""Publish a message over the socket."""
|
"""Publish a message over the socket."""
|
||||||
|
|
||||||
@@ -130,6 +130,7 @@ class Socket(object):
|
|||||||
try:
|
try:
|
||||||
self._socket.send_json(message)
|
self._socket.send_json(message)
|
||||||
self._socket.recv()
|
self._socket.recv()
|
||||||
|
break
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
if self._logger:
|
if self._logger:
|
||||||
self._logger.info('Publish Exception: %r; retry=%d',
|
self._logger.info('Publish Exception: %r; retry=%d',
|
||||||
|
|||||||
@@ -1193,7 +1193,6 @@ class JobTest(BaseJobTestMixin, django.test.TestCase):
|
|||||||
|
|
||||||
@override_settings(CELERY_ALWAYS_EAGER=True,
|
@override_settings(CELERY_ALWAYS_EAGER=True,
|
||||||
CELERY_EAGER_PROPAGATES_EXCEPTIONS=True,
|
CELERY_EAGER_PROPAGATES_EXCEPTIONS=True,
|
||||||
CALLBACK_CONSUMER_PORT='',
|
|
||||||
ANSIBLE_TRANSPORT='local')
|
ANSIBLE_TRANSPORT='local')
|
||||||
class JobStartCancelTest(BaseJobTestMixin, django.test.LiveServerTestCase):
|
class JobStartCancelTest(BaseJobTestMixin, django.test.LiveServerTestCase):
|
||||||
'''Job API tests that need to use the celery task backend.'''
|
'''Job API tests that need to use the celery task backend.'''
|
||||||
|
|||||||
Reference in New Issue
Block a user