1
0
Fork 0

Fix issues

pull/1260/head
Sampark Sharma 2022-12-09 07:56:15 +00:00 committed by GitHub
parent cb3dc49fec
commit d31c2dd88d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -92,21 +92,29 @@ export async function restoreCache(
let archivePath = '' let archivePath = ''
try { try {
try { try {
console.log('before first get cache entry')
// path are needed to compute version // path are needed to compute version
cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, { cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, {
compressionMethod compressionMethod
}) })
console.log('after first get cache entry')
console.log(cacheEntry)
} catch (error) { } catch (error) {
// This is to support the old cache entry created // This is to support the old cache entry created
// by the old version of the cache action on windows. // by the old version of the cache action on windows.
console.log('in first catch block')
if ( if (
process.platform === 'win32' && process.platform === 'win32' &&
compressionMethod !== CompressionMethod.Gzip compressionMethod !== CompressionMethod.Gzip
) { ) {
console.log(
"Couldn't find cache entry with zstd compression, falling back to gzip compression"
)
compressionMethod = CompressionMethod.Gzip compressionMethod = CompressionMethod.Gzip
cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, { cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, {
compressionMethod compressionMethod
}) })
console.log(cacheEntry)
if (!cacheEntry?.archiveLocation) { if (!cacheEntry?.archiveLocation) {
throw error throw error
} }
@ -148,6 +156,8 @@ export async function restoreCache(
return cacheEntry.cacheKey return cacheEntry.cacheKey
} catch (error) { } catch (error) {
console.log('In second catch block')
console.log(error)
const typedError = error as Error const typedError = error as Error
if (typedError.name === ValidationError.name) { if (typedError.name === ValidationError.name) {
throw error throw error
@ -183,7 +193,8 @@ export async function saveCache(
checkPaths(paths) checkPaths(paths)
checkKey(key) checkKey(key)
const compressionMethod = await utils.getCompressionMethod() // const compressionMethod = await utils.getCompressionMethod()
const compressionMethod = CompressionMethod.Gzip
let cacheId = -1 let cacheId = -1
const cachePaths = await utils.resolvePaths(paths) const cachePaths = await utils.resolvePaths(paths)