check_startup_update

Function check_startup_update 

Source
pub async fn check_startup_update() -> StartupUpdateResult
Expand description

Checks for a pending downloaded update at startup and applies it if ready.

This function:

  1. Checks if there’s a PendingUpdate record indicating a fully downloaded update
  2. If found, starts the atomic upgrade process
  3. If not found, quickly checks for updates (with a 5-second timeout)
  4. Returns immediately if the timeout is exceeded

This should be called early in workspace startup. If UpgradeStarted is returned, the process should exit to allow the canary upgrade to proceed.

§Returns

  • NoPendingUpdate: No update ready, continue startup
  • UpgradeStarted: Upgrade initiated, should exit
  • TimedOut: Check took too long, continue startup
  • Error: Something went wrong (logged, continue startup)