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:
24
24
_instance = None
25
25
_lock = Lock ()
26
26
_ready_event = asyncio .Event ()
27
- _thread = None
27
+ _loop : Union [asyncio .AbstractEventLoop , None ]
28
+ _thread : Thread
28
29
29
30
def __new__ (cls ):
30
31
# Ensure singleton precondition
@@ -46,7 +47,7 @@ def _run(self):
46
47
def stop (self ):
47
48
if self ._loop is not None :
48
49
self ._loop .call_soon_threadsafe (self ._loop .stop )
49
- self ._loop . close ()
50
+ self ._thread . join ()
50
51
51
52
def get_loop (self ):
52
53
if self ._loop is None :
@@ -200,3 +201,7 @@ def setLevel(level: int):
200
201
201
202
def silence ():
202
203
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):
160
160
"""Stop the module service and gRPC server"""
161
161
LOGGER .debug ("Shutting down module" )
162
162
try :
163
+ logging .shutdown ()
163
164
if self .parent is not None :
164
165
await self .parent .close ()
165
166
except Exception as e :
You can’t perform that action at this time.
0 commit comments