From a078bdd120908367923cf80445f267f165e89e12 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 3 Apr 2021 15:39:50 +0300 Subject: [PATCH] Retry client connection more times on startup --- maubot/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maubot/client.py b/maubot/client.py index 98d6c65..9e3d1a7 100644 --- a/maubot/client.py +++ b/maubot/client.py @@ -141,13 +141,13 @@ class Client: self.log.error(f"Invalid token: {e}. Disabling client") self.db_instance.enabled = False return - except MatrixRequestError: - if try_n >= 5: + except Exception as e: + if try_n >= 8: self.log.exception("Failed to get /account/whoami, disabling client") self.db_instance.enabled = False else: - self.log.exception(f"Failed to get /account/whoami, " - f"retrying in {(try_n + 1) * 10}s") + self.log.warning(f"Failed to get /account/whoami, " + f"retrying in {(try_n + 1) * 10}s: {e}") _ = asyncio.ensure_future(self.start(try_n + 1), loop=self.loop) return if user_id != self.id: