Skip to content

Commit

Permalink
client_handler check if ping task is cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrMuellerluedenscheid authored and FlorianLudwig committed Apr 1, 2021
1 parent b1ce650 commit 759f0ed
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions amqtt/mqtt/protocol/client_handler.py
Expand Up @@ -35,13 +35,10 @@ async def start(self):

async def stop(self):
await super().stop()
if self._ping_task:
try:
self.logger.debug("Cancel ping task")
self._ping_task.cancel()
except Exception as e:
self.logger.debug("Silenced exception %r", e)
pass
if self._ping_task and not self._ping_task.cancelled():
self.logger.debug("Cancel ping task")
self._ping_task.cancel()

if not self._disconnect_waiter.done():
self._disconnect_waiter.cancel()
self._disconnect_waiter = None
Expand Down

0 comments on commit 759f0ed

Please sign in to comment.