mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 23:17:32 -02:30
handle websocket unsubscribe
* Do not return from blocking unsubscribe until _after_ putting the gotten unsubscribe message on the queue so that it can be read by the thread of execution that was unblocked.
This commit is contained in:
committed by
Ryan Petrello
parent
3c5c9c6fde
commit
14320bc8e6
@@ -210,11 +210,13 @@ class WSClient(object):
|
|||||||
self._should_subscribe_to_pending_job['events'] == 'project_update_events'):
|
self._should_subscribe_to_pending_job['events'] == 'project_update_events'):
|
||||||
self._update_subscription(message['unified_job_id'])
|
self._update_subscription(message['unified_job_id'])
|
||||||
|
|
||||||
|
ret = self._recv_queue.put(message)
|
||||||
|
|
||||||
# unsubscribe acknowledgement
|
# unsubscribe acknowledgement
|
||||||
if 'groups_current' in message:
|
if 'groups_current' in message:
|
||||||
self._pending_unsubscribe.set()
|
self._pending_unsubscribe.set()
|
||||||
|
|
||||||
return self._recv_queue.put(message)
|
return ret
|
||||||
|
|
||||||
def _update_subscription(self, job_id):
|
def _update_subscription(self, job_id):
|
||||||
subscription = dict(jobs=self._should_subscribe_to_pending_job['jobs'])
|
subscription = dict(jobs=self._should_subscribe_to_pending_job['jobs'])
|
||||||
|
|||||||
Reference in New Issue
Block a user