real fix for reconnecting

This commit is contained in:
Timothy Pogue 2022-09-13 12:36:40 -06:00
parent 6d0dfd4dc8
commit 07aa206f71
1 changed files with 4 additions and 4 deletions

View File

@ -205,14 +205,14 @@ class ExternalMessageConsumer:
continue continue
except websockets.exceptions.ConnectionClosedOK: except websockets.exceptions.ConnectionClosedOK:
# Successfully closed, just end # Successfully closed, just keep trying to connect again indefinitely
return continue
except Exception as e: except Exception as e:
# An unforseen error has occurred, log and stop # An unforseen error has occurred, log and stop
logger.error("Unexpected error has occurred:") logger.error("Unexpected error has occurred:")
logger.exception(e) logger.exception(e)
break continue
async def _receive_messages( async def _receive_messages(
self, self,
@ -256,7 +256,7 @@ class ExternalMessageConsumer:
f"Ping error {channel} - retrying in {self.sleep_time}s") f"Ping error {channel} - retrying in {self.sleep_time}s")
await asyncio.sleep(self.sleep_time) await asyncio.sleep(self.sleep_time)
continue break
def handle_producer_message(self, producer: Dict[str, Any], message: Dict[str, Any]): def handle_producer_message(self, producer: Dict[str, Any], message: Dict[str, Any]):
""" """