Add a guard to break if no connection

If the WebSocket connection is already disconnected we don't have to
wait for messages

Change-Id: I7543c8e61711f036140db20416a57447da6c4c18
Closes-Bug: #1793264
This commit is contained in:
Quique Llorente 2018-09-19 13:00:54 +02:00
parent 9680a19dc9
commit 99b7a3d1d1
1 changed files with 3 additions and 0 deletions

View File

@ -138,6 +138,9 @@ class WebsocketClient(object):
messages.
"""
if not self._ws.connected:
return
if timeout is None:
LOG.warning("Waiting for messages on queue '{}' with no timeout."
.format(self._queue_name))