From 14055801c2b13c010500d09c3e297782cc86196f Mon Sep 17 00:00:00 2001 From: Josh Gross Date: Tue, 17 Dec 2019 17:01:57 -0500 Subject: [PATCH] Add missing await --- dist/restore/index.js | 2 +- dist/save/index.js | 2 +- src/cacheHttpClient.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/restore/index.js b/dist/restore/index.js index ca3896b..7399c50 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -1626,7 +1626,7 @@ function uploadFile(restClient, cacheId, archivePath) { const threads = new Array(concurrency); core.debug("Awaiting all uploads"); let offset = 0; - Promise.all(threads.map(() => __awaiter(this, void 0, void 0, function* () { + yield Promise.all(threads.map(() => __awaiter(this, void 0, void 0, function* () { while (offset < fileSize) { const chunkSize = offset + MAX_CHUNK_SIZE > fileSize ? fileSize - offset : MAX_CHUNK_SIZE; const start = offset; diff --git a/dist/save/index.js b/dist/save/index.js index 7cd1df9..edeff58 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -1626,7 +1626,7 @@ function uploadFile(restClient, cacheId, archivePath) { const threads = new Array(concurrency); core.debug("Awaiting all uploads"); let offset = 0; - Promise.all(threads.map(() => __awaiter(this, void 0, void 0, function* () { + yield Promise.all(threads.map(() => __awaiter(this, void 0, void 0, function* () { while (offset < fileSize) { const chunkSize = offset + MAX_CHUNK_SIZE > fileSize ? fileSize - offset : MAX_CHUNK_SIZE; const start = offset; diff --git a/src/cacheHttpClient.ts b/src/cacheHttpClient.ts index 00dcc7d..2433a68 100644 --- a/src/cacheHttpClient.ts +++ b/src/cacheHttpClient.ts @@ -185,7 +185,7 @@ async function uploadFile(restClient: RestClient, cacheId: number, archivePath: const threads = new Array(concurrency); core.debug("Awaiting all uploads"); let offset = 0; - Promise.all(threads.map(async () => { // This might not work cause something something closures + await Promise.all(threads.map(async () => { // This might not work cause something something closures while (offset < fileSize) { const chunkSize = offset + MAX_CHUNK_SIZE > fileSize ? fileSize - offset : MAX_CHUNK_SIZE; const start = offset;