mirror of https://github.com/actions/toolkit
adds backup download method for streaming cache
parent
868b4d32d5
commit
890c6b520f
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "github-actions.warp-cache",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"preview": true,
|
||||
"description": "Github action to use WarpBuild's in-house cache offering",
|
||||
"keywords": [
|
||||
|
|
|
@ -217,12 +217,36 @@ export async function restoreCache(
|
|||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await extractStreamingTar(
|
||||
readStream,
|
||||
archivePath,
|
||||
compressionMethod,
|
||||
downloadCommandPipe
|
||||
)
|
||||
} catch (error) {
|
||||
core.info(`Streaming download failed. Retrying: ${error}`)
|
||||
// Try to download the cache using the non-streaming method
|
||||
await cacheHttpClient.downloadCache(
|
||||
cacheEntry.provider,
|
||||
archiveLocation,
|
||||
archivePath,
|
||||
cacheEntry.gcs?.short_lived_token?.access_token ?? ''
|
||||
)
|
||||
|
||||
if (core.isDebug()) {
|
||||
await listTar(archivePath, compressionMethod)
|
||||
}
|
||||
|
||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath)
|
||||
core.info(
|
||||
`Cache Size: ~${Math.round(
|
||||
archiveFileSize / (1024 * 1024)
|
||||
)} MB (${archiveFileSize} B)`
|
||||
)
|
||||
|
||||
await extractTar(archivePath, compressionMethod)
|
||||
}
|
||||
core.info('Cache restored successfully')
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue