Skip to content

UpdateService

Defined in: src/update.ts:91

Tracks how far the running checkout is behind origin/ and, on demand, launches the existing deploy script to pull + rebuild + restart the service.

The check compares HEAD against origin/ after a fetch, so the badge surfaces individual new commits on main — no version tags required.

new UpdateService(deps?): UpdateService

Defined in: src/update.ts:102

UpdateDeps = {}

UpdateService

apply(): object

Defined in: src/update.ts:225

Kick off the detached deploy script. Guards against double-launch, but self-heals: once a prior deploy has finished (or crashed), the latch clears so a failed update can be retried. Returns started: false with a reason the UI can surface verbatim — never a bare status code.

object

optional error?: string

started: boolean


applyState(): DeployState

Defined in: src/update.ts:155

Read the detached deploy’s captured output to classify its state. Fail-safe: a missing/unreadable log is “idle”; an exit marker decides done/failed; a marker-less log that’s gone quiet past DEPLOY_STALE_MS is “failed” (crashed) so a stuck launch can’t block future updates forever.

DeployState


check(now): Promise<UpdateStatus>

Defined in: src/update.ts:192

Fetch origin and recompute how far behind the tracked branch we are. On any git/network failure, returns behind:0 (fail safe → no false update badge).

number

Promise<UpdateStatus>


current(): UpdateStatus | null

Defined in: src/update.ts:186

Last computed status, or null before the first check.

UpdateStatus | null