UNPKG

awscdk-construct-scte-scheduler

Version:

AWS CDK Construct for scheduling SCTE-35 events using the MediaLive schedule API

15 lines (14 loc) 419 B
import { MAXIMUM_RETRY_DELAY } from "./constants"; import { Retry } from "./retries-2026-config"; export class DefaultRetryBackoffStrategy { x = Retry.delay(); computeNextBackoffDelay(i) { const b = Math.random(); const r = 2; const t_i = b * Math.min(this.x * r ** i, MAXIMUM_RETRY_DELAY); return Math.floor(t_i); } setDelayBase(delay) { this.x = delay; } }