Treat error from restoring the cache as a cache miss (#68)

* Don't retry or error out on restore cache errors

Co-authored-by: Eliza Brock Marcum <eliza@elizamarcum.com>
This commit is contained in:
Benoit Daloze
2020-07-11 16:02:33 +02:00
committed by GitHub
co-authored by Eliza Brock Marcum
parent 973b1baf94
commit 1bb7de255b
2 changed files with 22 additions and 2 deletions
Generated Vendored
+11 -1
View File
@@ -2427,7 +2427,17 @@ async function bundleInstall(platform, engine, version) {
console.log(`Cache key: ${key}`)
// restore cache & install
const cachedKey = await cache.restoreCache(paths, key, restoreKeys)
let cachedKey = null
try {
cachedKey = await cache.restoreCache(paths, key, restoreKeys)
} catch (error) {
if (error.name === cache.ValidationError.name) {
throw error;
} else {
core.info(`[warning] There was an error restoring the cache ${error.message}`)
}
}
if (cachedKey) {
console.log(`Found cache for key: ${cachedKey}`)
}
+11 -1
View File
@@ -241,7 +241,17 @@ async function bundleInstall(platform, engine, version) {
console.log(`Cache key: ${key}`)
// restore cache & install
const cachedKey = await cache.restoreCache(paths, key, restoreKeys)
let cachedKey = null
try {
cachedKey = await cache.restoreCache(paths, key, restoreKeys)
} catch (error) {
if (error.name === cache.ValidationError.name) {
throw error;
} else {
core.info(`[warning] There was an error restoring the cache ${error.message}`)
}
}
if (cachedKey) {
console.log(`Found cache for key: ${cachedKey}`)
}