Skip to content

Commit

Permalink
Log only when retrying
Browse files Browse the repository at this point in the history
Co-authored-by: Tulir Asokan <[email protected]>
  • Loading branch information
Fizzadar and tulir authored Nov 13, 2023
1 parent db157c3 commit 4300745
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mautrix_telegram/abstract_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4300745

Please sign in to comment.