Merge pull request #177 from rkojedzinszky/task_leak_fix

hbmqtt.client: fix a Task leak
pull/8/head
Nicolas 2019-03-19 22:18:39 +01:00 zatwierdzone przez GitHub
commit 4aa6fe9821
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -66,7 +66,9 @@ def mqtt_connected(func):
def wrapper(self, *args, **kwargs):
if not self._connected_state.is_set():
base_logger.warning("Client not connected, waiting for it")
yield from asyncio.wait([self._connected_state.wait(), self._no_more_connections.wait()], return_when=asyncio.FIRST_COMPLETED)
_, pending = yield from asyncio.wait([self._connected_state.wait(), self._no_more_connections.wait()], return_when=asyncio.FIRST_COMPLETED)
for t in pending:
t.cancel()
if self._no_more_connections.is_set():
raise ClientException("Will not reconnect")
return (yield from func(self, *args, **kwargs))