Skip to content

Commit 906c24f

Browse files
committed
Add dedicated update information reload
Currently we have the /refresh_updates endpoint which updates the main component versions (Core, OS, Supervisor, Plug-ins) and the add-on store at the same time. This combined update causes more update information reloads than necessary. To allow fine grained update refresh control introduce a new endpoint /reload_updates which asks Supervisor to only update main component versions (learned through the version json files). The /store/reload endpoint already allows to update the add-on store separately.
1 parent 9d062c8 commit 906c24f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

supervisor/api/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ def _register_root(self) -> None:
345345
api_root.coresys = self.coresys
346346

347347
self.webapp.add_routes([web.get("/info", api_root.info)])
348+
self.webapp.add_routes([web.post("/reload_updates", api_root.reload_updates)])
349+
350+
# Deprecated
348351
self.webapp.add_routes([web.post("/refresh_updates", api_root.refresh_updates)])
349352
self.webapp.add_routes(
350353
[web.get("/available_updates", api_root.available_updates)]

supervisor/api/root.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,8 @@ async def refresh_updates(self, request: web.Request) -> None:
113113
await asyncio.shield(
114114
asyncio.gather(self.sys_updater.reload(), self.sys_store.reload())
115115
)
116+
117+
@api_process
118+
async def reload_updates(self, request: web.Request) -> None:
119+
"""Refresh updater update information."""
120+
await self.sys_updater.reload()

0 commit comments

Comments
 (0)