Skip to content

Commit

Permalink
Fix backoff calculation
Browse files Browse the repository at this point in the history
Accidentally let the minimum be `min * -1` instead of `min`. Whoops!
  • Loading branch information
JoshMock committed Jun 6, 2024
1 parent 3863134 commit 003353e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,5 +727,5 @@ export function lowerCaseHeaders (oldHeaders?: http.IncomingHttpHeaders): http.I
*/
function retryBackoff (min: number, max: number, attempt: number): number {
const ceiling = Math.min(max, 2 ** attempt) / 2
return ceiling + ((Math.random() * (ceiling - min)) - min)
return ceiling + ((Math.random() * (ceiling - min)) + min)
}

0 comments on commit 003353e

Please sign in to comment.