File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,22 @@ async def aenter(self) -> None:
62
62
await self .server .activate ()
63
63
64
64
# ----------------------------------------------------------------------------------------
65
- async def aexit (self , type , value , traceback ) -> None :
65
+ async def aexit (self , type = None , value = None , traceback = None ) :
66
66
"""
67
67
Asyncio context exit.
68
68
69
69
Stop service if one was started and releases any client resources.
70
70
"""
71
71
72
+ logger .debug (f"[DISSHU] { thing_type } aexit" )
73
+
72
74
if self .server is not None :
73
75
if self .context_specification .get ("start_as" ) == "process" :
74
- # Put in request to shutdown the server.
75
- await self .server .client_shutdown ()
76
+ # The server associated with this context is running?
77
+ if await self .is_process_alive ():
78
+ logger .debug (f"[DISSHU] { thing_type } calling client_shutdown" )
79
+ # Put in request to shutdown the server.
80
+ await self .server .client_shutdown ()
76
81
77
82
if self .context_specification .get ("start_as" ) == "coro" :
78
83
await self .server .direct_shutdown ()
You can’t perform that action at this time.
0 commit comments