Skip to main content

Function: releaseExpiredSpend()

releaseExpiredSpend(store, at, options?): Promise<number>

Defined in: packages/agentos/src/safety/runtime/SpendReservations.ts:277

Settles each reservation whose time is up and answers how many it settled. Without a resolver, an ordinary one settles at its whole amount, since its use was never confirmed, and one made with requireFence is left reserved. With resolve, each is decided by the host: consumed (its whole amount), released (nothing), or deferred until retryAt, still open and counted; a resolver that throws defers for 15 seconds, never settling on a failure. A sweep with resolve throws on a store that does not hold fenced reservations, and a reservation another process settled in the meantime is not counted. An operation's row is listed only once its time is up and no run holds a live lease, its amount the recorded figure, so a sweep without a resolver settles it there.

Parameters​

store​

SpendDayStore

at​

Date

options?​

resolve?​

(reservation) => Promise<SpendExpiryDecision>

Returns​

Promise<number>