File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ class _SingletonEventLoopThread:
2424 _instance = None
2525 _lock = Lock ()
2626 _ready_event = asyncio .Event ()
27- _thread = None
27+ _loop : Union [asyncio .AbstractEventLoop , None ]
28+ _thread : Thread
2829
2930 def __new__ (cls ):
3031 # Ensure singleton precondition
@@ -46,7 +47,7 @@ def _run(self):
4647 def stop (self ):
4748 if self ._loop is not None :
4849 self ._loop .call_soon_threadsafe (self ._loop .stop )
49- self ._loop . close ()
50+ self ._thread . join ()
5051
5152 def get_loop (self ):
5253 if self ._loop is None :
@@ -200,3 +201,7 @@ def setLevel(level: int):
200201
201202def silence ():
202203 setLevel (FATAL + 1 )
204+
205+
206+ def shutdown ():
207+ logging .shutdown ()
Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ async def stop(self):
160160 """Stop the module service and gRPC server"""
161161 LOGGER .debug ("Shutting down module" )
162162 try :
163+ logging .shutdown ()
163164 if self .parent is not None :
164165 await self .parent .close ()
165166 except Exception as e :
You can’t perform that action at this time.
0 commit comments