From e6e7b6156f2a057c3c09e099f2f7dcdb7e65a70a Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:11:54 +0000 Subject: [PATCH] updated segment size to 128MB for failing fast --- packages/cache/src/internal/downloadUtils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cache/src/internal/downloadUtils.ts b/packages/cache/src/internal/downloadUtils.ts index 265c34f7..7d44caf1 100644 --- a/packages/cache/src/internal/downloadUtils.ts +++ b/packages/cache/src/internal/downloadUtils.ts @@ -242,7 +242,9 @@ export async function downloadCacheStorageSDK( // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB // on 64-bit systems), split the download into multiple segments // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly. - const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH) + + // Updated segment size to 128MB to complete a segment faster and fail fast + const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH) const downloadProgress = new DownloadProgress(contentLength) const fd = fs.openSync(archivePath, 'w')