Skip to content

BacklogPoller

Defined in: src/backlog-poller.ts:14

Keeps the backlog counts cache warm so GET /api/backlog serves from memory instead of paying per-repo gh/Gitea round-trips on the request path — most visibly the cold first paint of an empty overview. Mirrors PrPoller’s boot-warmup + interval cadence.

The default cadence is intentionally below CountsService’s 60s read-TTL so a forced refresh rewrites each entry before it can expire — the request path then always finds a fresh value. Best-effort: a failing warm is swallowed so one bad repo never sinks the tick or its siblings.

new BacklogPoller(listRepos, resolveForge, warm, intervalMs?, onWarmed?): BacklogPoller

Defined in: src/backlog-poller.ts:17

() => object[]

(repoPath) => { kind?: string; } | null

(repoPath) => Promise<RepoCounts>

number = 45_000

() => void | Promise<void>

Fired once per tick after every repo’s counts are warm. Lets the caller push the freshly-warmed overview to clients (a backlog:update WS frame) so a long-open dashboard stays live instead of showing a fetch-once snapshot. Best-effort: a throwing hook is swallowed so the broadcast can never sink the warm cadence.

BacklogPoller

start(): void

Defined in: src/backlog-poller.ts:47

void


stop(): void

Defined in: src/backlog-poller.ts:51

void


tick(): Promise<void>

Defined in: src/backlog-poller.ts:32

Promise<void>