hephaestus/docs/how-to/self-update/self-update-poll-loop.md
Erich Blume 758854478b
All checks were successful
Build / validate (pull_request) Successful in 3m56s
C2(hephd-self-update): close self-update-poll-loop
Notify-only poller landed: ticks on the interval, logs when a newer
release is available. The daemon now self-reports update availability.
2026-06-04 13:42:48 -07:00

1.2 KiB

title modified tags requires
Self-update poll loop 2026-06-04
how-to
release-poll-version-check
self-update-opt-in-flag

Self-update poll loop

The background task that ties the flag to the version check. This card alone yields a working notify-only daemon ("update available: vX.Y.Z" in the log) — the apply path layers on after.

Deliverables

  • Spawn a tokio task modelled on spawn_sync_loop (crates/hephd/src/server.rs): tokio::time::interval ticking at the configured cadence, guarded so it's a no-op unless --self-update is set.
  • Each tick: run the release-poll-version-check. On "newer available", log it (and, once the apply path exists, hand off to cargo-install-from-tag).
  • Errors (forge unreachable, bad JSON) are logged and the loop continues — same resilience pattern the sync loop uses. A flaky forge must never crash or block the daemon.

Done when

With --self-update on and a stubbed/real "newer" release, the daemon logs an update-available line once per detection; with the flag off, no task runs. Requires release-poll-version-check and self-update-opt-in-flag. Part of hephd-self-update.