Skip to content

CountsService

Defined in: src/backlog.ts:127

new CountsService(forges, run, fetchFn?, maxConcurrency?, getRepoConfig?): CountsService

Defined in: src/backlog.ts:137

ForgeMap

CountsRunner

typeof fetch = fetch

number = DEFAULT_MAX_CONCURRENCY

(repoPath) => object

Optional: when provided, lightweight repos are treated as not-forge-backed. Read per call so a runtime repoMode toggle propagates without a restart.

CountsService

counts(repoPath): Promise<RepoCounts>

Defined in: src/backlog.ts:160

Read-through: serve a TTL-fresh cached value, else load it.

string

Promise<RepoCounts>


peek(repoPath): RepoCounts | null

Defined in: src/backlog.ts:155

Synchronous cache-only peek — returns the last cached value for repoPath (regardless of TTL freshness) or null when nothing has been cached yet. Never triggers a fetch, so a caller on the event loop (e.g. the rundown’s backlog-priority ranking) can read the kept-warm cache without an async forge round-trip. The backlog poller keeps these warm.

string

RepoCounts | null


refresh(repoPath): Promise<RepoCounts>

Defined in: src/backlog.ts:177

Force a refetch regardless of TTL — used by the background warmer to rewrite the cached value on a cadence so the request path always finds a fresh entry. Single-flight still dedupes against any in-flight load.

preserveOnError: a warm failure keeps the last-known-good value instead of clobbering it with nulls. The warmer runs every 45s, so without this a brief gh/network flake would blink the overview’s counts to null until the next successful warm. A genuinely expired entry still falls back to a live fetch on the request path, so persistent failures eventually surface as null.

string

Promise<RepoCounts>