Updated cache download to segment download

This commit is contained in:
Sankalp Kotewar
2022-08-18 05:32:49 +00:00
parent c202c38407
commit 4b6b45fe18
4 changed files with 14 additions and 8 deletions

View File

@@ -112,20 +112,21 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
result.segmentTimeoutInMs = copy.segmentTimeoutInMs
}
}
const customDownloadTimeoutMins = process.env['CACHE_DOWNLOAD_TIMEOUT_MINS']
const segmentDownloadTimeoutMins =
process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']
if (
customDownloadTimeoutMins &&
!isNaN(Number(customDownloadTimeoutMins)) &&
isFinite(Number(customDownloadTimeoutMins))
segmentDownloadTimeoutMins &&
!isNaN(Number(segmentDownloadTimeoutMins)) &&
isFinite(Number(segmentDownloadTimeoutMins))
) {
result.segmentTimeoutInMs = Number(customDownloadTimeoutMins) * 60 * 1000
result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1000
}
core.debug(`Use Azure SDK: ${result.useAzureSdk}`)
core.debug(`Download concurrency: ${result.downloadConcurrency}`)
core.debug(`Request timeout (ms): ${result.timeoutInMs}`)
core.debug(
`Cache download timeout mins env var: ${process.env['CACHE_DOWNLOAD_TIMEOUT_MINS']}`
`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`
)
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`)