summaryrefslogtreecommitdiff
path: root/kvmd/clients
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-08-05 18:19:31 +0300
committerMaxim Devaev <[email protected]>2022-08-05 18:19:31 +0300
commitd21e74700a5b236ea19981ff74724790a8bc4efc (patch)
tree9bda87884ece795b05a81bfc4863b4562e84d9ca /kvmd/clients
parenteeaeebf7c76385536eb8f5daaea5f21bda18b735 (diff)
shielded some tasks
Diffstat (limited to 'kvmd/clients')
-rw-r--r--kvmd/clients/kvmd.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/clients/kvmd.py b/kvmd/clients/kvmd.py
index 4a996be2..3f258a3b 100644
--- a/kvmd/clients/kvmd.py
+++ b/kvmd/clients/kvmd.py
@@ -170,10 +170,11 @@ class KvmdClientWs:
if writer_task:
writer_task.cancel()
try:
- await self.__ws.close()
+ await asyncio.shield(self.__ws.close())
except Exception:
pass
- self.__communicated = False
+ finally:
+ self.__communicated = False
async def send_key_event(self, key: str, state: bool) -> None:
await self.__writer_queue.put(("key", {"key": key, "state": state}))