diff --git a/dist/restore/index.js b/dist/restore/index.js index c76d3fd..a6964ee 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -1628,7 +1628,7 @@ function saveCache(cacheId, archivePath) { while (offset < fileSize) { const chunkSize = offset + MAX_CHUNK_SIZE > fileSize ? fileSize - offset : MAX_CHUNK_SIZE; const end = offset + chunkSize - 1; - const chunk = fs.createReadStream(archivePath, { fd, start: offset, end }); + const chunk = fs.createReadStream(archivePath, { fd, start: offset, end, autoClose: false }); uploads.push(yield uploadChunk(restClient, resourceUrl, chunk, offset, end)); // Making this serial offset += MAX_CHUNK_SIZE; } diff --git a/dist/save/index.js b/dist/save/index.js index 139362b..865ec4b 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -1628,7 +1628,7 @@ function saveCache(cacheId, archivePath) { while (offset < fileSize) { const chunkSize = offset + MAX_CHUNK_SIZE > fileSize ? fileSize - offset : MAX_CHUNK_SIZE; const end = offset + chunkSize - 1; - const chunk = fs.createReadStream(archivePath, { fd, start: offset, end }); + const chunk = fs.createReadStream(archivePath, { fd, start: offset, end, autoClose: false }); uploads.push(yield uploadChunk(restClient, resourceUrl, chunk, offset, end)); // Making this serial offset += MAX_CHUNK_SIZE; } diff --git a/src/cacheHttpClient.ts b/src/cacheHttpClient.ts index 87b9b66..195bdab 100644 --- a/src/cacheHttpClient.ts +++ b/src/cacheHttpClient.ts @@ -191,7 +191,7 @@ export async function saveCache( while (offset < fileSize) { const chunkSize = offset + MAX_CHUNK_SIZE > fileSize ? fileSize - offset : MAX_CHUNK_SIZE; const end = offset + chunkSize - 1; - const chunk = fs.createReadStream(archivePath, { fd, start: offset, end }); + const chunk = fs.createReadStream(archivePath, { fd, start: offset, end, autoClose: false }); uploads.push(await uploadChunk(restClient, resourceUrl, chunk, offset, end)); // Making this serial offset += MAX_CHUNK_SIZE; }