From 430074521adb87e403924ed48e1803ecc79d04be Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Mon, 13 Nov 2023 16:44:59 +0000 Subject: [PATCH] Log only when retrying Co-authored-by: Tulir Asokan --- mautrix_telegram/abstract_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mautrix_telegram/abstract_user.py b/mautrix_telegram/abstract_user.py index 53f07b44..3930fc87 100644 --- a/mautrix_telegram/abstract_user.py +++ b/mautrix_telegram/abstract_user.py @@ -311,10 +311,10 @@ async def start(self, delete_unless_authenticated: bool = False) -> AbstractUser try: await self.client.connect() except Exception: - self.log.exception("Exception connecting to Telegram, retrying in 5s...") attempts += 1 if attempts > 10: raise + self.log.exception("Exception connecting to Telegram, retrying in 5s...") await asyncio.sleep(5) self.log.debug(f"{'Bot' if self.is_relaybot else self.mxid} connected: {self.connected}") return self