1
0
Fork 0

Updated variable names

pull/1140/head
Sankalp Kotewar 2022-08-08 04:48:36 +00:00
parent 23cfbb3484
commit f9d38b0015
3 changed files with 12 additions and 12 deletions

View File

@ -8,7 +8,7 @@ import {
const useAzureSdk = true const useAzureSdk = true
const downloadConcurrency = 8 const downloadConcurrency = 8
const timeoutInMs = 30000 const timeoutInMs = 30000
const abortTimeInMs = 3600000 const segmentTimeoutInMs = 3600000
const uploadConcurrency = 4 const uploadConcurrency = 4
const uploadChunkSize = 32 * 1024 * 1024 const uploadChunkSize = 32 * 1024 * 1024
@ -19,7 +19,7 @@ test('getDownloadOptions sets defaults', async () => {
useAzureSdk, useAzureSdk,
downloadConcurrency, downloadConcurrency,
timeoutInMs, timeoutInMs,
abortTimeInMs segmentTimeoutInMs
}) })
}) })
@ -28,7 +28,7 @@ test('getDownloadOptions overrides all settings', async () => {
useAzureSdk: false, useAzureSdk: false,
downloadConcurrency: 14, downloadConcurrency: 14,
timeoutInMs: 20000, timeoutInMs: 20000,
abortTimeInMs: 3600000 segmentTimeoutInMs: 3600000
} }
const actualOptions = getDownloadOptions(expectedOptions) const actualOptions = getDownloadOptions(expectedOptions)

View File

@ -249,9 +249,9 @@ export async function downloadCacheStorageSDK(
try { try {
downloadProgress.startDisplayTimer() downloadProgress.startDisplayTimer()
const abortTimeInMs = const segmentTimeoutInMs =
options.abortTimeInMs === undefined ? 3600000 : options.abortTimeInMs options.segmentTimeoutInMs === undefined ? 3600000 : options.segmentTimeoutInMs
const abortSignal = AbortController.timeout(abortTimeInMs) const abortSignal = AbortController.timeout(segmentTimeoutInMs)
abortSignal.addEventListener('abort', () => { abortSignal.addEventListener('abort', () => {
core.warning('Cache download aborted, segment download timed out.') core.warning('Cache download aborted, segment download timed out.')
}) })

View File

@ -48,11 +48,11 @@ export interface DownloadOptions {
timeoutInMs?: number timeoutInMs?: number
/** /**
* Time after which download should be aborted if stuck * Time after which a segment download should be aborted if stuck
* *
* @default 3600000 * @default 3600000
*/ */
abortTimeInMs?: number segmentTimeoutInMs?: number
} }
/** /**
@ -92,7 +92,7 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
useAzureSdk: true, useAzureSdk: true,
downloadConcurrency: 8, downloadConcurrency: 8,
timeoutInMs: 30000, timeoutInMs: 30000,
abortTimeInMs: 3600000 segmentTimeoutInMs: 3600000
} }
if (copy) { if (copy) {
@ -108,15 +108,15 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
result.timeoutInMs = copy.timeoutInMs result.timeoutInMs = copy.timeoutInMs
} }
if (typeof copy.abortTimeInMs === 'number') { if (typeof copy.segmentTimeoutInMs === 'number') {
result.abortTimeInMs = copy.abortTimeInMs result.segmentTimeoutInMs = copy.segmentTimeoutInMs
} }
} }
core.debug(`Use Azure SDK: ${result.useAzureSdk}`) core.debug(`Use Azure SDK: ${result.useAzureSdk}`)
core.debug(`Download concurrency: ${result.downloadConcurrency}`) core.debug(`Download concurrency: ${result.downloadConcurrency}`)
core.debug(`Request timeout (ms): ${result.timeoutInMs}`) core.debug(`Request timeout (ms): ${result.timeoutInMs}`)
core.debug(`Abort time (ms): ${result.abortTimeInMs}`) core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`)
return result return result
} }