From 8a5ee448383f22ba3094c584c613ecb06b1a729f Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Mon, 20 Nov 2023 23:05:49 -0500 Subject: [PATCH] set retry limit and make retries visible logs (#170) --- lib/installer.js | 6 ++++-- src/installer.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/installer.js b/lib/installer.js index 0d4f2e1..3964a18 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -84,8 +84,9 @@ function getJuliaVersionInfo() { const versionsFile = yield retry((bail) => __awaiter(this, void 0, void 0, function* () { return yield tc.downloadTool('https://julialang-s3.julialang.org/bin/versions.json'); }), { + retries: 5, onRetry: (err) => { - core.debug(`Download of versions.json failed, trying again. Error: ${err}`); + core.info(`Download of versions.json failed, trying again. Error: ${err}`); } }); return JSON.parse(fs.readFileSync(versionsFile).toString()); @@ -226,8 +227,9 @@ function installJulia(versionInfo, version, arch) { const juliaDownloadPath = yield retry((bail) => __awaiter(this, void 0, void 0, function* () { return yield tc.downloadTool(downloadURL); }), { + retries: 5, onRetry: (err) => { - core.debug(`Download of ${downloadURL} failed, trying again. Error: ${err}`); + core.info(`Download of ${downloadURL} failed, trying again. Error: ${err}`); } }); // Verify checksum diff --git a/src/installer.ts b/src/installer.ts index af402b3..d19eac9 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -54,8 +54,9 @@ export async function getJuliaVersionInfo(): Promise { const versionsFile = await retry(async (bail: Function) => { return await tc.downloadTool('https://julialang-s3.julialang.org/bin/versions.json') }, { + retries: 5, onRetry: (err: Error) => { - core.debug(`Download of versions.json failed, trying again. Error: ${err}`) + core.info(`Download of versions.json failed, trying again. Error: ${err}`) } }) @@ -208,8 +209,9 @@ export async function installJulia(versionInfo, version: string, arch: string): const juliaDownloadPath = await retry(async (bail: Function) => { return await tc.downloadTool(downloadURL) }, { + retries: 5, onRetry: (err: Error) => { - core.debug(`Download of ${downloadURL} failed, trying again. Error: ${err}`) + core.info(`Download of ${downloadURL} failed, trying again. Error: ${err}`) } })