Skip to content

Commit f030db1

Browse files
chore(*): Extract exponential backoff logic
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 842b6c6 commit f030db1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

integration_test/tests/utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ export async function retry<T>(fn: () => Promise<T>, options?: RetryOptions): Pr
2727
} catch (e) {
2828
lastError = e as Error;
2929
}
30-
// Use exponential backoff for retries to be more efficient
31-
const delay = Math.min(1000 * Math.pow(1.5, count), 10000); // Max 10s delay
32-
await timeout(delay);
30+
// Use exponential backoff for retries to be more efficient
31+
const BACKOFF_FACTOR = 1.5;
32+
const delay = Math.min(1000 * Math.pow(BACKOFF_FACTOR, count), 10000); // Max 10s delay
33+
await timeout(delay);
3334
count++;
3435
}
3536

0 commit comments

Comments
 (0)