From 7109681d9963698a19b0703345486a10b3d4a930 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 7 Mar 2024 09:25:58 +0100 Subject: [PATCH] try reconnections on LocalProtocolError, fix #135 --- matrix_webhook/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matrix_webhook/utils.py b/matrix_webhook/utils.py index 780b710..72172a7 100644 --- a/matrix_webhook/utils.py +++ b/matrix_webhook/utils.py @@ -90,5 +90,8 @@ async def send_room_message(room_id, content): except LocalProtocolError as e: msg = f"Send error: {e}" LOGGER.error(msg) + LOGGER.warning("Reconnecting") + if conf.MATRIX_PW: + await CLIENT.login(conf.MATRIX_PW) LOGGER.warning("Trying again") return create_json_response(HTTPStatus.GATEWAY_TIMEOUT, "Homeserver not responding")