mirror of https://github.com/actions/toolkit
adds better info messages. reduces retry timeout for simple download. makes cache miss record instead of failing workflow
parent
e5677fba9b
commit
f120696e60
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "github-actions.warp-cache",
|
"name": "github-actions.warp-cache",
|
||||||
"version": "1.1.7",
|
"version": "1.1.8",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Github action to use WarpBuild's in-house cache offering",
|
"description": "Github action to use WarpBuild's in-house cache offering",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
@ -225,8 +225,9 @@ export async function restoreCache(
|
||||||
downloadCommandPipe
|
downloadCommandPipe
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
core.debug(`Failed to download cache: ${error}`)
|
||||||
core.info(
|
core.info(
|
||||||
`Streaming download failed. Retrying with multipart: ${error}`
|
`Streaming download failed. Likely a cloud provider issue. Retrying with multipart download`
|
||||||
)
|
)
|
||||||
// Wait 1 second
|
// Wait 1 second
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000))
|
await new Promise(resolve => setTimeout(resolve, 1000))
|
||||||
|
@ -239,16 +240,24 @@ export async function restoreCache(
|
||||||
cacheEntry.gcs?.short_lived_token?.access_token ?? ''
|
cacheEntry.gcs?.short_lived_token?.access_token ?? ''
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
core.debug(`Failed to download cache: ${error}`)
|
||||||
core.info(
|
core.info(
|
||||||
`Multipart Download failed. Retrying with basic download: ${error}`
|
`Multipart download failed. Likely a cloud provider issue. Retrying with basic download`
|
||||||
)
|
)
|
||||||
|
// Wait 1 second
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000))
|
await new Promise(resolve => setTimeout(resolve, 1000))
|
||||||
|
// Try to download the cache using the basic method
|
||||||
|
try {
|
||||||
await cacheHttpClient.downloadCacheSingleThread(
|
await cacheHttpClient.downloadCacheSingleThread(
|
||||||
cacheEntry.provider,
|
cacheEntry.provider,
|
||||||
archiveLocation,
|
archiveLocation,
|
||||||
archivePath,
|
archivePath,
|
||||||
cacheEntry.gcs?.short_lived_token?.access_token ?? ''
|
cacheEntry.gcs?.short_lived_token?.access_token ?? ''
|
||||||
)
|
)
|
||||||
|
} catch (error) {
|
||||||
|
core.info('Cache Miss. Failed to download cache.')
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
|
|
|
@ -317,7 +317,6 @@ export async function downloadCacheMultipartGCP(
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.debug(`Failed to download cache: ${error}`)
|
core.debug(`Failed to download cache: ${error}`)
|
||||||
core.error(`Failed to download cache.`)
|
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,13 +330,14 @@ export async function downloadCacheGCP(
|
||||||
const {bucketName, objectName} =
|
const {bucketName, objectName} =
|
||||||
utils.retrieveGCSBucketAndObjectName(archiveLocation)
|
utils.retrieveGCSBucketAndObjectName(archiveLocation)
|
||||||
|
|
||||||
|
storage.retryOptions.totalTimeout = 120
|
||||||
|
|
||||||
await storage.bucket(bucketName).file(objectName).download({
|
await storage.bucket(bucketName).file(objectName).download({
|
||||||
destination: archivePath,
|
destination: archivePath,
|
||||||
validation: 'crc32c'
|
validation: 'crc32c'
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.debug(`Failed to download cache: ${error}`)
|
core.debug(`Failed to download cache: ${error}`)
|
||||||
core.error(`Failed to download cache.`)
|
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -367,7 +367,6 @@ export function downloadCacheStreamingGCP(
|
||||||
return storage.bucket(bucketName).file(objectName).createReadStream()
|
return storage.bucket(bucketName).file(objectName).createReadStream()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.debug(`Failed to download cache: ${error}`)
|
core.debug(`Failed to download cache: ${error}`)
|
||||||
core.error(`Failed to download cache.`)
|
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue