From ba462956ea9821dff1b2fc4df4820f4bc48f15ef Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 8 Aug 2022 13:22:11 +0000 Subject: [PATCH] Updated error message and null check --- packages/cache/src/internal/downloadUtils.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/cache/src/internal/downloadUtils.ts b/packages/cache/src/internal/downloadUtils.ts index d9f4bfd3..c92cc999 100644 --- a/packages/cache/src/internal/downloadUtils.ts +++ b/packages/cache/src/internal/downloadUtils.ts @@ -249,13 +249,11 @@ export async function downloadCacheStorageSDK( try { downloadProgress.startDisplayTimer() - const segmentTimeoutInMs = - options.segmentTimeoutInMs === undefined - ? 3600000 - : options.segmentTimeoutInMs - const abortSignal = AbortController.timeout(segmentTimeoutInMs) + const abortSignal = AbortController.timeout( + options.segmentTimeoutInMs || 3600000 + ) abortSignal.addEventListener('abort', () => { - core.warning('Cache download aborted, segment download timed out.') + core.warning('Aborting cache download as it exceeded the timeout.') }) while (!downloadProgress.isDone()) { const segmentStart = @@ -277,7 +275,6 @@ export async function downloadCacheStorageSDK( onProgress: downloadProgress.onProgress() } ) - fs.writeFileSync(fd, result) } } finally {