We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4130661 commit 62ac8a7Copy full SHA for 62ac8a7
1 file changed
juju/client/connection.py
@@ -456,9 +456,7 @@ async def close(self, to_reconnect=False):
456
if not to_reconnect:
457
try:
458
log.debug('Gathering all tasks for connection close')
459
-
460
- # Avoid gathering the current task
461
- tasks_need_to_be_gathered = [task for task in jasyncio.all_tasks() if task != jasyncio.current_task()]
+ tasks_need_to_be_gathered = [self._receiver_task, self._pinger_task]
462
await jasyncio.gather(*tasks_need_to_be_gathered)
463
except jasyncio.CancelledError:
464
pass
0 commit comments