Skip to content

Commit

Permalink
updated segment size to 128MB for failing fast
Browse files Browse the repository at this point in the history
  • Loading branch information
kotewar authored Mar 6, 2023
1 parent f3de1e5 commit e6e7b61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/cache/src/internal/downloadUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit e6e7b61

Please sign in to comment.