From: Benjamin Braatz Date: Tue, 26 Oct 2021 15:21:40 +0000 (+0200) Subject: Bug fix: Connections not properly closed. X-Git-Tag: v0.3.0~11 X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=10c351dbe8a6ea572527f2842585723cb9b119a9;p=graphit%2Fcontrolpi-wsserver.git Bug fix: Connections not properly closed. --- diff --git a/controlpi_plugins/wsserver.py b/controlpi_plugins/wsserver.py index 599a856..6e5db0a 100644 --- a/controlpi_plugins/wsserver.py +++ b/controlpi_plugins/wsserver.py @@ -93,9 +93,10 @@ class Connection: else: await self._bus.send(Message(self._name, message)) except ConnectionClosed: - await self._bus.send(Message(self._name, - {'event': 'connection closed'})) - self._bus.unregister(self._name) + pass + await self._bus.send(Message(self._name, + {'event': 'connection closed'})) + self._bus.unregister(self._name) Response = Optional[Tuple[http.HTTPStatus, Headers, bytes]]