From 7109681d9963698a19b0703345486a10b3d4a930 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 7 Mar 2024 09:25:58 +0100 Subject: [PATCH 1/2] 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") From 3012559b50d9bca2692f9a59240b994497c6620b Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 7 Mar 2024 09:28:03 +0100 Subject: [PATCH 2/2] add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7efb76b..9b8f5db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 by [@timo-schluessler](https://github.com/timo-schluessler) - replace black & isort by ruff - update dependencies +- try to reconnect on LocalProtocolError ## [v3.8.0] - 2023-04-08