Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -177,23 +177,7 @@ homeassistant.components.pure_energie.*
homeassistant.components.rainmachine.*
homeassistant.components.rdw.*
homeassistant.components.recollect_waste.*
homeassistant.components.recorder
homeassistant.components.recorder.const
homeassistant.components.recorder.core
homeassistant.components.recorder.backup
homeassistant.components.recorder.executor
homeassistant.components.recorder.history
homeassistant.components.recorder.models
homeassistant.components.recorder.pool
homeassistant.components.recorder.purge
homeassistant.components.recorder.repack
homeassistant.components.recorder.run_history
homeassistant.components.recorder.services
homeassistant.components.recorder.statistics
homeassistant.components.recorder.system_health
homeassistant.components.recorder.tasks
homeassistant.components.recorder.util
homeassistant.components.recorder.websocket_api
homeassistant.components.recorder.*
homeassistant.components.remote.*
homeassistant.components.renault.*
homeassistant.components.ridwell.*
Expand Down
8 changes: 6 additions & 2 deletions homeassistant/components/recorder/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,8 @@ def _setup_recorder(self) -> None | int:
while tries <= self.db_max_retries:
try:
self._setup_connection()
return migration.get_schema_version(self)
assert self.get_session is not None
Comment thread
bdraco marked this conversation as resolved.
Outdated
return migration.get_schema_version(self.get_session)
except Exception as err: # pylint: disable=broad-except
_LOGGER.exception(
"Error during connection setup: %s (retrying in %s seconds)",
Expand All @@ -612,9 +613,12 @@ def _migrate_schema_and_setup_run(self, current_version: int) -> bool:
"recorder_database_migration",
)
self.hass.add_job(self._async_migration_started)
assert self.get_session is not None

try:
migration.migrate_schema(self, current_version)
migration.migrate_schema(
self.hass, self.engine, self.get_session, current_version
)
except exc.DatabaseError as err:
if self._handle_database_error(err):
return True
Expand Down
Loading