File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 7
7
8
8
from graphql import DocumentNode , ExecutionResult , print_ast
9
9
from websockets .datastructures import HeadersLike
10
+ from websockets .exceptions import ConnectionClosed
10
11
from websockets .typing import Subprotocol
11
12
12
13
from .exceptions import (
@@ -505,10 +506,15 @@ async def _after_initialize(self):
505
506
self .send_ping_task = asyncio .ensure_future (self ._send_ping_coro ())
506
507
507
508
async def _close_hook (self ):
509
+ log .debug ("_close_hook: start" )
508
510
509
511
# Properly shut down the send ping task if enabled
510
512
if self .send_ping_task is not None :
513
+ log .debug ("_close_hook: cancelling send_ping_task" )
511
514
self .send_ping_task .cancel ()
512
- with suppress (asyncio .CancelledError ):
515
+ with suppress (asyncio .CancelledError , ConnectionClosed ):
516
+ log .debug ("_close_hook: awaiting send_ping_task" )
513
517
await self .send_ping_task
514
518
self .send_ping_task = None
519
+
520
+ log .debug ("_close_hook: end" )
You can’t perform that action at this time.
0 commit comments