Skip to content

Commit 1bb7de2

Browse files
eregonelizamarcum
andauthored
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 <[email protected]>
1 parent 973b1ba commit 1bb7de2

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

dist/index.js

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,17 @@ async function bundleInstall(platform, engine, version) {
241241
console.log(`Cache key: ${key}`)
242242

243243
// restore cache & install
244-
const cachedKey = await cache.restoreCache(paths, key, restoreKeys)
244+
let cachedKey = null
245+
try {
246+
cachedKey = await cache.restoreCache(paths, key, restoreKeys)
247+
} catch (error) {
248+
if (error.name === cache.ValidationError.name) {
249+
throw error;
250+
} else {
251+
core.info(`[warning] There was an error restoring the cache ${error.message}`)
252+
}
253+
}
254+
245255
if (cachedKey) {
246256
console.log(`Found cache for key: ${cachedKey}`)
247257
}

0 commit comments

Comments
 (0)