Skip to content

Commit d6e45a2

Browse files
committed
fix(executor): clamp jitter within maxDelayMs to honour delay cap
1 parent 5c8c135 commit d6e45a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎apps/sim/executor/utils/retry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function calculateBackoffDelay(attempt: number, initialDelayMs: number, maxDelay
2020
const exponential = initialDelayMs * Math.pow(2, attempt)
2121
const capped = Math.min(maxDelayMs, exponential)
2222
const jitter = Math.random() * capped * 0.2
23-
return Math.floor(capped + jitter)
23+
return Math.floor(Math.min(capped + jitter, maxDelayMs))
2424
}
2525

2626
function parseRetryAfterHeader(headers: Headers): number | null {

0 commit comments

Comments
 (0)