Improve the flow with fallback if there is a network issue (#1670)

This commit is contained in:
Pascal Vizeli 2020-04-22 11:06:59 +02:00 committed by GitHub
parent ffa91e150d
commit ebfaaeaa6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -34,9 +34,6 @@ class Core(CoreSysAttributes):
"""Setup supervisor orchestration."""
self.state = CoreStates.STARTUP
# load last available data
await self.sys_updater.load()
# Load DBus
await self.sys_dbus.load()
@ -46,6 +43,9 @@ class Core(CoreSysAttributes):
# Load Plugins container
await self.sys_plugins.load()
# load last available data
await self.sys_updater.load()
# Load Home Assistant
await self.sys_homeassistant.load()

View File

@ -252,15 +252,13 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
_LOGGER.info("Setup HomeAssistant landingpage")
while True:
try:
await self.instance.install(
"landingpage", image=self.sys_updater.image_homeassistant
)
await self.instance.install("landingpage", image=self.image)
except DockerAPIError:
_LOGGER.warning("Fails install landingpage, retry after 30sec")
await asyncio.sleep(30)
else:
self.version = self.instance.version
self.image = self.sys_updater.image_homeassistant
self.image = self.instance.image
self.save_data()
break