This commit is contained in:
Jozef Steinhübl 2024-04-02 12:23:12 +02:00
parent 4be6d096f9
commit 1bacd6f089
3 changed files with 3 additions and 3 deletions

2
dist/setup/index.js generated vendored

File diff suppressed because one or more lines are too long

View file

@ -88,7 +88,7 @@ export default async (options: Input): Promise<Output> => {
if (!cacheHit) { if (!cacheHit) {
info(`Downloading a new version of Bun: ${url}`); info(`Downloading a new version of Bun: ${url}`);
// TODO: remove this, temporary fix for https://github.com/oven-sh/setup-bun/issues/73 // TODO: remove this, temporary fix for https://github.com/oven-sh/setup-bun/issues/73
revision = await retry(async () => await downloadBun(url, bunPath), 3); revision = await retry(async () => await downloadBun(url, bunPath), 5);
console.log("Downloaded Bun revision: " + revision); console.log("Downloaded Bun revision: " + revision);
} }

View file

@ -1,7 +1,7 @@
export function retry<T>( export function retry<T>(
fn: () => Promise<T>, fn: () => Promise<T>,
retries: number, retries: number,
timeout = 5000 timeout = 10000
): Promise<T> { ): Promise<T> {
return fn().catch((err) => { return fn().catch((err) => {
if (retries <= 0) { if (retries <= 0) {