def backoff_for

cswap-bend-cli@0.1.0.0 · policy/usage.bend:374

import cswap-bend-cli@0.1.0.0/policy/usage.bend as Usage
import Base
import cswap-bend-cli@0.1.0.0/policy/types.bend as T

374# Seconds of backoff after the n-th consecutive failure: 30, 60, 120, 240,
375# 480, 600; a server's Retry-After raises it (Retry-After 0 on an http-429
376# means at least 300 s).
377def backoff_for(+n: Nat, +e: T.ErrKind, +ra: Maybe<&2, Nat>) -> Nat:
378  backoff.retry(backoff.rate_limited(e), ra, backoff.cap(n))

Uses (6)

Used by (1)