kopia lustrzana https://github.com/Yakifo/amqtt
client_handler check if ping task is cancelled
rodzic
2558107708
commit
95a8260a69
|
@ -35,13 +35,10 @@ class ClientProtocolHandler(ProtocolHandler):
|
|||
|
||||
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
|
||||
|
|
Ładowanie…
Reference in New Issue