Skip to content

Commit

Permalink
Don't require bot startup for bridge startup
Browse files Browse the repository at this point in the history
The bridge can function just fine without it, we don't need to treat it
as a fatal error.
  • Loading branch information
tadzik committed Nov 29, 2021
1 parent 6702831 commit 60e0835
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mautrix_telegram/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ def prepare_bridge(self) -> None:
init_portal(self.context)
self.add_startup_actions(init_puppet(self.context))

if self.bot:
self.add_startup_actions(self.bot.start())
if self.config["bridge.resend_bridge_info"]:
self.add_startup_actions(self.resend_bridge_info())

Expand All @@ -112,6 +110,12 @@ def prepare_bridge(self) -> None:
async def start(self) -> None:
await super().start()

if self.bot:
try:
await self.bot.start()
except Exception as e:
self.log.error(f"Failed to start bot: {e}")

semaphore = None
concurrency = self.config['telegram.connection.concurrent_connections_startup']
if concurrency:
Expand Down

0 comments on commit 60e0835

Please sign in to comment.