Prevent calling stop or restart services during db upgrade (#49098)

This commit is contained in:
J. Nick Koston
2021-04-12 14:18:38 -10:00
committed by GitHub
parent 65126cec3e
commit 53853f035d
8 changed files with 270 additions and 32 deletions

View File

@ -0,0 +1,15 @@
"""Helpers to check recorder."""
from homeassistant.core import HomeAssistant
async def async_migration_in_progress(hass: HomeAssistant) -> bool:
"""Check to see if a recorder migration is in progress."""
if "recorder" not in hass.config.components:
return False
from homeassistant.components import ( # pylint: disable=import-outside-toplevel
recorder,
)
return await recorder.async_migration_in_progress(hass)