mirror of
https://github.com/ansible/awx.git
synced 2026-01-10 15:32:07 -03: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:
parent
3c5c9c6fde
commit
14320bc8e6
@ -210,11 +210,13 @@ class WSClient(object):
|
||||
self._should_subscribe_to_pending_job['events'] == 'project_update_events'):
|
||||
self._update_subscription(message['unified_job_id'])
|
||||
|
||||
ret = self._recv_queue.put(message)
|
||||
|
||||
# unsubscribe acknowledgement
|
||||
if 'groups_current' in message:
|
||||
self._pending_unsubscribe.set()
|
||||
|
||||
return self._recv_queue.put(message)
|
||||
return ret
|
||||
|
||||
def _update_subscription(self, job_id):
|
||||
subscription = dict(jobs=self._should_subscribe_to_pending_job['jobs'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user