Update __init__.py (#4877)
Cleaner exit by not throwing exception if server was not set during initialization of component (ref https://github.com/home-assistant/home-assistant/pull/4866)
This commit is contained in:
parent
e4b6395250
commit
6da3e23436
1 changed files with 5 additions and 3 deletions
|
@ -323,10 +323,12 @@ class HomeAssistantWSGI(object):
|
|||
@asyncio.coroutine
|
||||
def stop(self):
|
||||
"""Stop the wsgi server."""
|
||||
self.server.close()
|
||||
yield from self.server.wait_closed()
|
||||
if self.server:
|
||||
self.server.close()
|
||||
yield from self.server.wait_closed()
|
||||
yield from self.app.shutdown()
|
||||
yield from self._handler.finish_connections(60.0)
|
||||
if self._handler:
|
||||
yield from self._handler.finish_connections(60.0)
|
||||
yield from self.app.cleanup()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue