File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
src/xchembku_lib/datafaces Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,21 @@ async def aenter(self):
4646 await self .server .start_process ()
4747
4848 # ----------------------------------------------------------------------------------------
49- async def aexit (self , type , value , traceback ):
50- """ """
49+ async def aexit (self , type = None , value = None , traceback = None ):
50+ """
51+ Asyncio context exit.
52+
53+ Stop service if one was started and releases any client resources.
54+ """
55+ logger .debug (f"[DISSHU] { thing_type } aexit" )
5156
5257 if self .server is not None :
5358 if self .context_specification .get ("start_as" ) == "process" :
54- # Put in request to shutdown the server.
55- await self .server .client_shutdown ()
59+ # The server associated with this context is running?
60+ if await self .is_process_alive ():
61+ logger .debug (f"[DISSHU] { thing_type } calling client_shutdown" )
62+ # Put in request to shutdown the server.
63+ await self .server .client_shutdown ()
5664
5765 if self .context_specification .get ("start_as" ) == "coro" :
5866 await self .server .direct_shutdown ()
You can’t perform that action at this time.
0 commit comments