From 574cd74b5815b5a917627ad0950dc635759cbe88 Mon Sep 17 00:00:00 2001 From: Josh Gross Date: Tue, 17 Dec 2019 17:08:48 -0500 Subject: [PATCH] ? --- dist/restore/index.js | 2 ++ dist/save/index.js | 2 ++ src/cacheHttpClient.ts | 3 +++ 3 files changed, 7 insertions(+) diff --git a/dist/restore/index.js b/dist/restore/index.js index 7399c50..c419ecf 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -1631,10 +1631,12 @@ function uploadFile(restClient, cacheId, archivePath) { const chunkSize = offset + MAX_CHUNK_SIZE > fileSize ? fileSize - offset : MAX_CHUNK_SIZE; const start = offset; const end = offset + chunkSize - 1; + core.debug(`Start: ${start} End: ${end}`); offset += MAX_CHUNK_SIZE; // Do this before losing thread during await? const chunk = fs.createReadStream(archivePath, { fd, start, end, autoClose: false }); responses.push(yield uploadChunk(restClient, resourceUrl, chunk, start, end)); } + return Promise.resolve(); }))); fs.closeSync(fd); const failedResponse = responses.find(x => !isSuccessStatusCode(x.statusCode)); diff --git a/dist/save/index.js b/dist/save/index.js index edeff58..eb3b98f 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -1631,10 +1631,12 @@ function uploadFile(restClient, cacheId, archivePath) { const chunkSize = offset + MAX_CHUNK_SIZE > fileSize ? fileSize - offset : MAX_CHUNK_SIZE; const start = offset; const end = offset + chunkSize - 1; + core.debug(`Start: ${start} End: ${end}`); offset += MAX_CHUNK_SIZE; // Do this before losing thread during await? const chunk = fs.createReadStream(archivePath, { fd, start, end, autoClose: false }); responses.push(yield uploadChunk(restClient, resourceUrl, chunk, start, end)); } + return Promise.resolve(); }))); fs.closeSync(fd); const failedResponse = responses.find(x => !isSuccessStatusCode(x.statusCode)); diff --git a/src/cacheHttpClient.ts b/src/cacheHttpClient.ts index 2433a68..a78a0e9 100644 --- a/src/cacheHttpClient.ts +++ b/src/cacheHttpClient.ts @@ -190,10 +190,13 @@ async function uploadFile(restClient: RestClient, cacheId: number, archivePath: const chunkSize = offset + MAX_CHUNK_SIZE > fileSize ? fileSize - offset : MAX_CHUNK_SIZE; const start = offset; const end = offset + chunkSize - 1; + core.debug(`Start: ${start} End: ${end}`); offset += MAX_CHUNK_SIZE; // Do this before losing thread during await? const chunk = fs.createReadStream(archivePath, { fd, start, end, autoClose: false }); responses.push(await uploadChunk(restClient, resourceUrl, chunk, start, end)); } + + return Promise.resolve(); })); fs.closeSync(fd);