Merge branch 'main' into kotewar/updating-blobstorage-client-to-12.13.0

This commit is contained in:
Sankalp Kotewar
2023-03-09 00:33:52 +05:30
committed by GitHub
11 changed files with 125 additions and 10 deletions

View File

@@ -53,6 +53,15 @@ export interface DownloadOptions {
* @default 3600000
*/
segmentTimeoutInMs?: number
/**
* Weather to skip downloading the cache entry.
* If lookupOnly is set to true, the restore function will only check if
* a matching cache entry exists and return the cache key if it does.
*
* @default false
*/
lookupOnly?: boolean
}
/**
@@ -93,6 +102,7 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
downloadConcurrency: 8,
timeoutInMs: 30000,
segmentTimeoutInMs: 600000
lookupOnly: false
}
if (copy) {
@@ -111,6 +121,10 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
if (typeof copy.segmentTimeoutInMs === 'number') {
result.segmentTimeoutInMs = copy.segmentTimeoutInMs
}
if (typeof copy.lookupOnly === 'boolean') {
result.lookupOnly = copy.lookupOnly
}
}
const segmentDownloadTimeoutMins =
process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']
@@ -129,6 +143,7 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`
)
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`)
core.debug(`Lookup only: ${result.lookupOnly}`)
return result
}