shielded some tasks

This commit is contained in:
Maxim Devaev
2022-08-05 18:19:31 +03:00
parent eeaeebf7c7
commit d21e74700a
8 changed files with 30 additions and 20 deletions

View File

@@ -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}))