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)pull/4886/head
parent
e4b6395250
commit
6da3e23436
|
@ -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…
Reference in New Issue