set retry limit and make retries visible logs (#170)

This commit is contained in:
Ian Butterworth
2023-11-20 23:05:49 -05:00
committed by GitHub
parent 84c4368e8a
commit 8a5ee44838
2 changed files with 8 additions and 4 deletions

6
lib/installer.js generated
View File

@@ -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

View File

@@ -54,8 +54,9 @@ export async function getJuliaVersionInfo(): Promise<object> {
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}`)
}
})