From 82b6db0b08030f55be84f55d08111bbec0119083 Mon Sep 17 00:00:00 2001 From: James Riehl Date: Fri, 28 Jul 2023 08:56:11 +0100 Subject: [PATCH] chore: failure workaround no longer needed for babble 0.3.0 --- src/uagents/config.py | 1 - src/uagents/wallet_messaging.py | 12 +----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/uagents/config.py b/src/uagents/config.py index 9f98baa9..7320b23c 100644 --- a/src/uagents/config.py +++ b/src/uagents/config.py @@ -30,7 +30,6 @@ class AgentNetwork(Enum): MAILBOX_POLL_INTERVAL_SECONDS = 1.0 WALLET_MESSAGING_POLL_INTERVAL_SECONDS = 2.0 -WALLET_MESSAGING_MAX_CONSECUTIVE_FAILURES = 10 DEFAULT_ENVELOPE_TIMEOUT_SECONDS = 30 diff --git a/src/uagents/wallet_messaging.py b/src/uagents/wallet_messaging.py index bdf2be29..124e74ef 100644 --- a/src/uagents/wallet_messaging.py +++ b/src/uagents/wallet_messaging.py @@ -12,7 +12,6 @@ from uagents.config import ( WALLET_MESSAGING_POLL_INTERVAL_SECONDS, - WALLET_MESSAGING_MAX_CONSECUTIVE_FAILURES, get_logger, ) from uagents.context import Context, WalletMessageCallback @@ -65,24 +64,15 @@ async def send( async def poll_server(self): self._logger.info("Connecting to wallet messaging server") - consecutive_failures = 0 while True: try: for msg in self._client.receive(): await self._message_queue.put(msg) - consecutive_failures = 0 - except ( # pylint: disable=W0703 + except ( HTTPError, ConnectionError, JSONDecodeError, - BaseException, ) as ex: - consecutive_failures += 1 - if consecutive_failures > WALLET_MESSAGING_MAX_CONSECUTIVE_FAILURES: - self._logger.exception( - "Failed to retrieve wallet messages too many times. Shutting down now." - ) - sys.exit(1) self._logger.warning( f"Failed to get messages from wallet messaging server: {ex}" )