File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -442,11 +442,15 @@ async def close(self, to_reconnect=False):
442442 self .monitor .close_called .set ()
443443
444444 # Cancel all the tasks (that we started):
445+ tasks_need_to_be_gathered = []
445446 if self ._pinger_task :
447+ tasks_need_to_be_gathered .append (self ._pinger_task )
446448 self ._pinger_task .cancel ()
447449 if self ._receiver_task :
450+ tasks_need_to_be_gathered .append (self ._receiver_task )
448451 self ._receiver_task .cancel ()
449452 if self ._debug_log_task :
453+ tasks_need_to_be_gathered .append (self ._debug_log_task )
450454 self ._debug_log_task .cancel ()
451455
452456 if self ._ws and not self ._ws .closed :
@@ -456,7 +460,6 @@ async def close(self, to_reconnect=False):
456460 if not to_reconnect :
457461 try :
458462 log .debug ('Gathering all tasks for connection close' )
459- tasks_need_to_be_gathered = [self ._receiver_task , self ._pinger_task ]
460463 await jasyncio .gather (* tasks_need_to_be_gathered )
461464 except jasyncio .CancelledError :
462465 pass
You can’t perform that action at this time.
0 commit comments