mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-15 05:06:30 +00:00
Avoid loading add-on store repositories too early (#5716)
When initially loading the store manager, update_repositories makes sure that all repositories are actually present. If they are for some reason corrupted or content is missing, we currently still trying to load them which leads to an unnecessary warning: ``` 2025-03-03 11:55:54.324 WARNING (SyncWorker_1) [supervisor.store.data] No repository information exists at /data/addons/git/a0d7b954 ... 2025-03-03 11:55:54.343 INFO (MainThread) [supervisor.store.git] Cloning add-on https://github.com/hassio-addons/repository repository ``` Since update_repositories always loads the data, simply remove the superfluous earlier loading attempt. While at it, also improve the cloning/update log messages to make it clear what repository is cloned/updated.
This commit is contained in:
parent
a7c6699f6a
commit
9a3702bc1a
@ -75,8 +75,6 @@ class StoreManager(CoreSysAttributes, FileConfiguration):
|
|||||||
|
|
||||||
async def load(self) -> None:
|
async def load(self) -> None:
|
||||||
"""Start up add-on management."""
|
"""Start up add-on management."""
|
||||||
await self.data.update()
|
|
||||||
|
|
||||||
# Init custom repositories and load add-ons
|
# Init custom repositories and load add-ons
|
||||||
await self.update_repositories(
|
await self.update_repositories(
|
||||||
self._data[ATTR_REPOSITORIES], add_with_errors=True
|
self._data[ATTR_REPOSITORIES], add_with_errors=True
|
||||||
|
@ -97,7 +97,9 @@ class GitRepo(CoreSysAttributes):
|
|||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_LOGGER.info("Cloning add-on %s repository", self.url)
|
_LOGGER.info(
|
||||||
|
"Cloning add-on %s repository from %s", self.path, self.url
|
||||||
|
)
|
||||||
self.repo = await self.sys_run_in_executor(
|
self.repo = await self.sys_run_in_executor(
|
||||||
ft.partial(
|
ft.partial(
|
||||||
git.Repo.clone_from, self.url, str(self.path), **git_args
|
git.Repo.clone_from, self.url, str(self.path), **git_args
|
||||||
@ -128,7 +130,7 @@ class GitRepo(CoreSysAttributes):
|
|||||||
return
|
return
|
||||||
|
|
||||||
async with self.lock:
|
async with self.lock:
|
||||||
_LOGGER.info("Update add-on %s repository", self.url)
|
_LOGGER.info("Update add-on %s repository from %s", self.path, self.url)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
branch = self.repo.active_branch.name
|
branch = self.repo.active_branch.name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user