Skip to content

Commit

Permalink
Don't send notice for first polling error
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Aug 1, 2023
1 parent 4ead577 commit a4e1d2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mautrix_twitter/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a4e1d2b

Please sign in to comment.