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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BacklogPoller(
listRepos,resolveForge,warm,intervalMs?,onWarmed?):BacklogPoller
Defined in: src/backlog-poller.ts:17
Parameters
Section titled “Parameters”listRepos
Section titled “listRepos”() => object[]
resolveForge
Section titled “resolveForge”(repoPath) => { kind?: string; } | null
(repoPath) => Promise<RepoCounts>
intervalMs?
Section titled “intervalMs?”number = 45_000
onWarmed?
Section titled “onWarmed?”() => 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.
Returns
Section titled “Returns”BacklogPoller
Methods
Section titled “Methods”start()
Section titled “start()”start():
void
Defined in: src/backlog-poller.ts:47
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop():
void
Defined in: src/backlog-poller.ts:51
Returns
Section titled “Returns”void
tick()
Section titled “tick()”tick():
Promise<void>
Defined in: src/backlog-poller.ts:32
Returns
Section titled “Returns”Promise<void>