Documentation
¶
Overview ¶
Package reconcile prices events that were stored without a cost.
budgetclaw stores an event whose model the pricing table does not know rather than discarding it (see db.InsertUnpriced). Those rows keep their full token counts, so once the table learns the model the spend can be recovered from the rows themselves. This package is what does that, automatically, with no user action.
It depends on both db and pricing, which is why it is its own package: db stays free of any pricing dependency, and pricing stays free of any storage dependency. The caller wires the two together.
The pass is safe to run from several places at once. Every update is guarded so a second run, or a racing process, prices nothing twice.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
Result reports what a pass did. Repriced is the number of events that gained a cost; Recovered is the dollar total those events added. Remaining counts rows still unpriceable, which is a legitimate steady state (a retired model with no interval covering an old event).
func Run ¶
Run prices whatever it can of the unpriced backlog.
It is cheap to call unconditionally. The healthy case costs one indexed existence probe and returns immediately, so callers can run it at startup without thinking about it.
force skips the watermark check. Use it when the effective pricing table may have changed in a way the tag does not capture, or when the user explicitly asked for a repair pass.