diff --git a/dist/restore/index.js b/dist/restore/index.js index 86d20e2..f187667 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -1623,7 +1623,7 @@ function uploadFile(restClient, cacheId, archivePath) { const responses = []; const fd = fs.openSync(archivePath, "r"); // Use the same fd for serial reads? Will this work for parallel too? const concurrency = 4; // # of HTTP requests in parallel - const threads = new Array(concurrency); + const threads = [...new Array(concurrency).keys()]; core.debug("Awaiting all uploads"); let offset = 0; yield Promise.all(threads.map(() => __awaiter(this, void 0, void 0, function* () { diff --git a/dist/save/index.js b/dist/save/index.js index 040fdc3..d447efb 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -1623,7 +1623,7 @@ function uploadFile(restClient, cacheId, archivePath) { const responses = []; const fd = fs.openSync(archivePath, "r"); // Use the same fd for serial reads? Will this work for parallel too? const concurrency = 4; // # of HTTP requests in parallel - const threads = new Array(concurrency); + const threads = [...new Array(concurrency).keys()]; core.debug("Awaiting all uploads"); let offset = 0; yield Promise.all(threads.map(() => __awaiter(this, void 0, void 0, function* () { diff --git a/src/cacheHttpClient.ts b/src/cacheHttpClient.ts index 65ad1f4..a8a22bd 100644 --- a/src/cacheHttpClient.ts +++ b/src/cacheHttpClient.ts @@ -182,7 +182,7 @@ async function uploadFile(restClient: RestClient, cacheId: number, archivePath: const fd = fs.openSync(archivePath, "r"); // Use the same fd for serial reads? Will this work for parallel too? const concurrency = 4; // # of HTTP requests in parallel - const threads = new Array(concurrency); + const threads = [...new Array(concurrency).keys()]; core.debug("Awaiting all uploads"); let offset = 0; await Promise.all(threads.map(async () => { // This might not work cause something something closures