We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37728ee commit c3c12bdCopy full SHA for c3c12bd
src/client.ts
@@ -464,10 +464,8 @@ export function createClient<
464
connectionAckWaitTimeout = 0,
465
retryAttempts = 5,
466
retryWait = async function randomisedExponentialBackoff(retries) {
467
- let retryDelay = 1000; // start with 1s delay
468
- for (let i = 0; i < retries; i++) {
469
- retryDelay *= 2;
470
- }
+ // start with 1s delay at retries === 0
+ const retryDelay = 1000 * Math.pow(2, retries);
471
await new Promise((resolve) =>
472
setTimeout(
473
resolve,
0 commit comments