update ws channel send to add data to queue

This commit is contained in:
Timothy Pogue
2022-10-09 18:49:04 -06:00
parent 2c76dd9e39
commit 71bbffd10a
2 changed files with 14 additions and 3 deletions

View File

@@ -174,6 +174,7 @@ class ExternalMessageConsumer:
:param producer: Dictionary containing producer info
:param lock: An asyncio Lock
"""
channel = None
while self._running:
try:
host, port = producer['host'], producer['port']
@@ -224,6 +225,10 @@ class ExternalMessageConsumer:
logger.exception(e)
continue
finally:
if channel:
await channel.close()
async def _receive_messages(
self,
channel: WebSocketChannel,