Skip to content

Build invoice payment retry budget manager #234

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

src/retryEngine.ts's RetryEngine retries per-call; for a payer making many payments in a session, an overall retry "budget" prevents one degraded period from exhausting excessive total retry time across all calls combined.

Technical Context

New src/retryBudget.ts. Tracks cumulative retry time/count across calls sharing a RetryEngine instance; once budget exhausted, subsequent calls fail fast without retrying until the budget window resets.

Acceptance Criteria

  • RetryBudget.consume(retryDurationMs) / .hasRemaining(): boolean / resets on a rolling window
  • RetryEngine (existing) accepts an optional shared RetryBudget and checks it before each retry attempt
  • Tests: budget exhaustion stops further retries; window reset restores budget

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions