yera.ui.updates.service
Coordination for cached server-UI update checks.
Symbols
refresh_update_state
refresh_update_state(
settings: Settings,
client: httpx.AsyncClient,
path: Path | None = None,
now: datetime | None = None,
) → UpdateCheckState | NoneReturn current update state, refreshing it when necessary.
Parameters
Global Yera settings controlling automatic update checks.
HTTP client used for a due metadata request.
Explicit persisted-state path, or None for the default.
Current time, injectable for deterministic tests.
Returns
Current update-check state, or None when checks are disabled.
UpdateService
Manage background release checks and their current cached result.
Methods
UpdateService.__init__
__init__(
settings: Settings,
path: Path | None = None,
installed_version: str | None = None,
transport: httpx.AsyncBaseTransport | None = None,
timeout_seconds: float = 2.0,
) → NoneConfigure the server-UI update service.
Parameters
Global settings controlling automatic checks.
Explicit persisted-state path, or None for the default.
Installed Yera version, injectable for tests.
Optional HTTP transport for isolated testing.
Maximum duration of the metadata request.
UpdateService.refresh
refresh() → NoneRefresh cached update state when its check interval has elapsed.
UpdateService.available_update
available_update() → ReleaseMetadata | NoneReturn a cached release when it is newer than installed Yera.
Returns
Validated metadata for a newer release, otherwise None.