Преглед изворни кода

Class retrying connection errors as `TRANSIENT_DISCONNECT`

Nick Barrett пре 2 година
родитељ
комит
2fa6865ee6
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      mautrix_instagram/user.py

+ 2 - 2
mautrix_instagram/user.py

@@ -958,7 +958,7 @@ class User(DBUser, BaseUser):
             await self.send_bridge_notice(
             await self.send_bridge_notice(
                 f"Error in listener: {e}",
                 f"Error in listener: {e}",
                 important=True,
                 important=True,
-                state_event=BridgeStateEvent.UNKNOWN_ERROR,
+                state_event=BridgeStateEvent.TRANSIENT_DISCONNECT,
                 error_code="ig-connection-error-maybe-auth",
                 error_code="ig-connection-error-maybe-auth",
             )
             )
             self.mqtt.disconnect()
             self.mqtt.disconnect()
@@ -967,7 +967,7 @@ class User(DBUser, BaseUser):
             self.log.exception("Fatal error in listener, reconnecting in 5 minutes")
             self.log.exception("Fatal error in listener, reconnecting in 5 minutes")
             await self.send_bridge_notice(
             await self.send_bridge_notice(
                 "Fatal error in listener (see logs for more info)",
                 "Fatal error in listener (see logs for more info)",
-                state_event=BridgeStateEvent.UNKNOWN_ERROR,
+                state_event=BridgeStateEvent.TRANSIENT_DISCONNECT,
                 important=True,
                 important=True,
                 error_code="ig-unknown-connection-error",
                 error_code="ig-unknown-connection-error",
                 info={"python_error": str(e)},
                 info={"python_error": str(e)},