Skip to content

Commit 8ed8c69

Browse files
committed
Block execution of fetch_data and store reload jobs
Block execution of fetch_data and store reload jobs if the core version is unsupported. This essentially freezes the installation until the user takes action and updates the Core version to a supported one.
1 parent b99fa27 commit 8ed8c69

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

supervisor/misc/tasks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,11 @@ async def _watchdog_addon_application(self):
358358

359359
@Job(
360360
name="tasks_reload_store",
361-
conditions=[JobCondition.SUPERVISOR_UPDATED, JobCondition.OS_SUPPORTED],
361+
conditions=[
362+
JobCondition.SUPERVISOR_UPDATED,
363+
JobCondition.OS_SUPPORTED,
364+
JobCondition.CORE_SUPPORTED,
365+
],
362366
)
363367
async def _reload_store(self) -> None:
364368
"""Reload store and check for addon updates."""

supervisor/store/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ async def load(self) -> None:
7474

7575
@Job(
7676
name="store_manager_reload",
77-
conditions=[JobCondition.SUPERVISOR_UPDATED, JobCondition.OS_SUPPORTED],
77+
conditions=[
78+
JobCondition.SUPERVISOR_UPDATED,
79+
JobCondition.OS_SUPPORTED,
80+
JobCondition.CORE_SUPPORTED,
81+
],
7882
on_condition=StoreJobError,
7983
)
8084
async def reload(self, repository: Repository | None = None) -> None:
@@ -117,6 +121,7 @@ async def reload(self, repository: Repository | None = None) -> None:
117121
JobCondition.INTERNET_SYSTEM,
118122
JobCondition.SUPERVISOR_UPDATED,
119123
JobCondition.OS_SUPPORTED,
124+
JobCondition.CORE_SUPPORTED,
120125
],
121126
on_condition=StoreJobError,
122127
)

supervisor/updater.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,11 @@ async def _check_connectivity(self, connectivity: bool):
247247

248248
@Job(
249249
name="updater_fetch_data",
250-
conditions=[JobCondition.INTERNET_SYSTEM, JobCondition.OS_SUPPORTED],
250+
conditions=[
251+
JobCondition.INTERNET_SYSTEM,
252+
JobCondition.OS_SUPPORTED,
253+
JobCondition.CORE_SUPPORTED,
254+
],
251255
on_condition=UpdaterJobError,
252256
throttle_period=timedelta(seconds=30),
253257
concurrency=JobConcurrency.QUEUE,

0 commit comments

Comments
 (0)