createRollupJob
@forge/monorepo / backend/src / createRollupJob
Function: createRollupJob()
createRollupJob(
deps):object
Defined in: backend/src/usage/rollups.ts:33
Parameters
deps
Returns
rebuildRange()
rebuildRange(
context,input):Promise<readonlyUsageRollup[]>
Rebuild a specific range, for a backfill or after a correcting event.
Parameters
context
tenantId
input
from
string
period
"hour" | "day" | "week" | "month"
to
string
Returns
Promise<readonly UsageRollup[]>
run()
run(
context,input):Promise<{rebuilt:number;remaining:number; }>
Rebuild one page of stale buckets — AC-4.
A page at a time, so an interruption loses at most a page and no bookkeeping. Rebuilding is a recomputation, so re-running a bucket cannot double count and two workers racing one bucket write the same value — which is what makes "safe under concurrency" a property of the design rather than a lock.
Parameters
context
tenantId
input
limit
number
period
"hour" | "day" | "week" | "month"
since
string
Returns
Promise<{ rebuilt: number; remaining: number; }>