diff --git a/CHANGELOG.md b/CHANGELOG.md index 508cdf4..ccf95f1 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 - add mwe gitlab webhook formatter. Intergrations are better for now ## [v3.8.0] - 2023-04-08 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")