Ensure frontend is available if integrations fail to start - Part 1 of 2 (#36093)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
9c45115468
commit
fbe7b4ddfa
13 changed files with 173 additions and 63 deletions
|
@ -29,6 +29,9 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
ERROR_LOG_FILENAME = "home-assistant.log"
|
||||
|
||||
# How long to wait until things that run on bootstrap have to finish.
|
||||
TIMEOUT_EVENT_BOOTSTRAP = 15
|
||||
|
||||
# hass.data key for logging information.
|
||||
DATA_LOGGING = "logging"
|
||||
|
||||
|
@ -44,6 +47,13 @@ STAGE_1_INTEGRATIONS = {
|
|||
"mqtt_eventstream",
|
||||
# To provide account link implementations
|
||||
"cloud",
|
||||
# Ensure supervisor is available
|
||||
"hassio",
|
||||
# Get the frontend up and running as soon
|
||||
# as possible so problem integrations can
|
||||
# be removed
|
||||
"frontend",
|
||||
"config",
|
||||
}
|
||||
|
||||
|
||||
|
@ -399,6 +409,8 @@ async def _async_set_up_integrations(
|
|||
)
|
||||
|
||||
if stage_1_domains:
|
||||
_LOGGER.info("Setting up %s", stage_1_domains)
|
||||
|
||||
await async_setup_multi_components(stage_1_domains)
|
||||
|
||||
# Load all integrations
|
||||
|
@ -442,4 +454,11 @@ async def _async_set_up_integrations(
|
|||
|
||||
# Wrap up startup
|
||||
_LOGGER.debug("Waiting for startup to wrap up")
|
||||
await hass.async_block_till_done()
|
||||
try:
|
||||
async with timeout(TIMEOUT_EVENT_BOOTSTRAP):
|
||||
await hass.async_block_till_done()
|
||||
except asyncio.TimeoutError:
|
||||
_LOGGER.warning(
|
||||
"Something is blocking Home Assistant from wrapping up the "
|
||||
"bootstrap phase. We're going to continue anyway."
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue