mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Prevent calling stop or restart services during db upgrade (#49098)
This commit is contained in:
15
homeassistant/helpers/recorder.py
Normal file
15
homeassistant/helpers/recorder.py
Normal 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)
|
Reference in New Issue
Block a user