From a4e1d2b56008fcada3113024e0d721f6eb0ef4c1 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 1 Aug 2023 17:44:53 +0300 Subject: [PATCH] Don't send notice for first polling error --- mautrix_twitter/user.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mautrix_twitter/user.py b/mautrix_twitter/user.py index 7ed7e9c..85da781 100644 --- a/mautrix_twitter/user.py +++ b/mautrix_twitter/user.py @@ -345,7 +345,10 @@ async def on_error(self, evt: PollingErrored) -> None: state_event=BridgeStateEvent.UNKNOWN_ERROR, important=evt.fatal, ) - elif evt.count == 1 and self.config["bridge.temporary_disconnect_notices"]: + elif evt.count == 1: + # Ignore first error, Twitter spams them way too often nowadays + return + elif evt.count == 2 and self.config["bridge.temporary_disconnect_notices"]: await self.send_bridge_notice( f"Error while polling Twitter: {evt.error}\nThe bridge will keep retrying.", state_event=BridgeStateEvent.TRANSIENT_DISCONNECT,