Create an issue when database backups fail because the system runs out of resources (#109020)

This commit is contained in:
J. Nick Koston
2024-01-30 10:23:58 -10:00
committed by GitHub
parent 6174aa4e59
commit a22244707b
4 changed files with 48 additions and 1 deletions

View File

@ -470,6 +470,24 @@ def _async_create_mariadb_range_index_regression_issue(
)
@callback
def async_create_backup_failure_issue(
hass: HomeAssistant,
local_start_time: datetime,
) -> None:
"""Create an issue when the backup fails because we run out of resources."""
ir.async_create_issue(
hass,
DOMAIN,
"backup_failed_out_of_resources",
is_fixable=False,
severity=ir.IssueSeverity.CRITICAL,
learn_more_url="https://www.home-assistant.io/integrations/recorder",
translation_key="backup_failed_out_of_resources",
translation_placeholders={"start_time": local_start_time.strftime("%H:%M:%S")},
)
def setup_connection_for_dialect(
instance: Recorder,
dialect_name: str,