From 14320bc8e6c6c97baf29ba6faffca1e5ed6f0e04 Mon Sep 17 00:00:00 2001 From: chris meyers Date: Mon, 17 Feb 2020 09:04:16 -0500 Subject: [PATCH] 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. --- awxkit/awxkit/ws.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awxkit/awxkit/ws.py b/awxkit/awxkit/ws.py index 11668641bd..ea34410b9a 100644 --- a/awxkit/awxkit/ws.py +++ b/awxkit/awxkit/ws.py @@ -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'])