MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / trackAttempts

Function trackAttempts

e2e/cloud/billing-customer-provisioning.test.ts:228–236  ·  view source on GitHub ↗
(atLeast: number)

Source from the content-addressed store, hash-verified

226 // Attempts against THIS org's meter, polled until the seam has settled on
227 // `atLeast` of them — the ledger is the only place the retry is visible.
228 const trackAttempts = (atLeast: number) =>
229 autumn.ledgerFor("balances.track").pipe(
230 Effect.map((entries) => entries.filter((entry) => entry.customerId === customerId)),
231 Effect.filterOrFail(
232 (entries) => entries.length >= atLeast,
233 (entries) => `only ${entries.length}/${atLeast} usage-track attempts for ${customerId}`,
234 ),
235 Effect.retry(Schedule.both(Schedule.spaced("250 millis"), Schedule.recurs(40))),
236 );
237
238 yield* Effect.gen(function* () {
239 // "No such customer" that does NOT go away when the customer is created —

Calls 1

retryMethod · 0.80

Tested by

no test coverage detected