From f33a3f4748eb5cf38c639495f05f6b80479449e0 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 28 Mar 2024 18:14:40 +0000 Subject: [PATCH] Remove finalize --- .../src/internal/upload/blob-upload.ts | 36 ++++--------------- packages/artifact/src/internal/upload/zip.ts | 2 +- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 888077c0..87bb7237 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -52,22 +52,14 @@ export async function uploadZipToBlobStorage( zipUploadStream.pipe(hashStream).setEncoding('hex') // This stream is used to compute a hash of the zip content that gets used. Integrity check core.info('Beginning upload of artifact content to blob storage') + try { - await new Promise((resolve, reject) => { - uploadStream.on('readable', async () => { - try { - await blockBlobClient.uploadStream( - uploadStream, - bufferSize, - maxConcurrency, - options - ) - resolve('success') - } catch (error) { - reject(error) - } - }) - }) + await blockBlobClient.uploadStream( + uploadStream, + bufferSize, + maxConcurrency, + options + ) } catch (error) { if (NetworkError.isNetworkErrorCode(error?.code)) { throw new NetworkError(error?.code) @@ -75,20 +67,6 @@ export async function uploadZipToBlobStorage( throw error } - // try { - // await blockBlobClient.uploadStream( - // uploadStream, - // bufferSize, - // maxConcurrency, - // options - // ) - // } catch (error) { - // if (NetworkError.isNetworkErrorCode(error?.code)) { - // throw new NetworkError(error?.code) - // } - - // throw error - // } core.info('Finished uploading artifact content to blob storage!') diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index e8a7117a..23c521b4 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -63,7 +63,7 @@ export async function createZipUploadStream( }) } - zip.finalize() + // zip.finalize() const bufferSize = getUploadChunkSize() const zipUploadStream = new ZipUploadStream(bufferSize) core.debug(