fix: Improve error handling in restoreCache (fixes #120) (#122)

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
Michael Vorburger 2026-01-08 18:25:30 +01:00 committed by GitHub
parent 43d7d5ceab
commit 271e4c2614
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 9 deletions

9
dist/main/index.js vendored
View file

@ -104219,9 +104219,10 @@ async function restoreCache(cacheConfig) {
}
const delay = Math.random() * 1000 // timeout <= 1 sec to reduce 429 errors
await index_setTimeout(delay, async function () {
core.startGroup(`Restore cache for ${cacheConfig.name}`)
await index_setTimeout(delay)
core.startGroup(`Restore cache for ${cacheConfig.name}`)
try {
const hash = await glob.hashFiles(cacheConfig.files.join('\n'))
const name = cacheConfig.name
const paths = cacheConfig.paths
@ -104244,9 +104245,9 @@ async function restoreCache(cacheConfig) {
} else {
core.info(`Failed to restore ${name} cache`)
}
} finally {
core.endGroup()
}())
}
}
run()

File diff suppressed because one or more lines are too long

View file

@ -152,9 +152,10 @@ async function restoreCache(cacheConfig) {
}
const delay = Math.random() * 1000 // timeout <= 1 sec to reduce 429 errors
await setTimeout(delay, async function () {
core.startGroup(`Restore cache for ${cacheConfig.name}`)
await setTimeout(delay)
core.startGroup(`Restore cache for ${cacheConfig.name}`)
try {
const hash = await glob.hashFiles(cacheConfig.files.join('\n'))
const name = cacheConfig.name
const paths = cacheConfig.paths
@ -177,9 +178,9 @@ async function restoreCache(cacheConfig) {
} else {
core.info(`Failed to restore ${name} cache`)
}
} finally {
core.endGroup()
}())
}
}
run()