import { BackoffFunction } from "./BackoffFunction" ; import { RetryConfig } from "./RetryConfig" ; const SLEEP_CAP_MS = 5000 ; const SLEEP_BASE_MS = 10 ; param retryAttempt param error param transactionId internal export const defaultBackoffFunction = ( retryAttempt , error , transactionId ) => { const exponentialBackoff = Math . min ( SLEEP_CAP_MS , Math . pow ( SLEEP_BASE_MS * 2 , retryAttempt ) ) ; const jitterRand = Math . random ( ) ; const delayTime = jitterRand * exponentialBackoff ; return delayTime ; } ; export const defaultRetryConfig = new RetryConfig ( 4 , defaultBackoffFunction ) ;