Gracefully exit with async logger (#4965)
* Gracefully exit with async logger * Lint
This commit is contained in:
parent
a76684f203
commit
01e6bd2c92
2 changed files with 27 additions and 3 deletions
|
@ -298,9 +298,8 @@ class HomeAssistant(object):
|
|||
# cleanup async layer from python logging
|
||||
if self.data.get(DATA_ASYNCHANDLER):
|
||||
handler = self.data.pop(DATA_ASYNCHANDLER)
|
||||
logger = logging.getLogger('')
|
||||
handler.close()
|
||||
logger.removeHandler(handler)
|
||||
logging.getLogger('').removeHandler(handler)
|
||||
yield from handler.async_close(blocking=True)
|
||||
|
||||
self.loop.stop()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue