From 4a272e90530ba272dcc251d638f0aa4bffe91f61 Mon Sep 17 00:00:00 2001 From: Bassem Dghaidi <568794+Link-@users.noreply.github.com> Date: Mon, 2 Dec 2024 03:08:05 -0800 Subject: [PATCH] Troubleshoot --- packages/cache/src/internal/uploadUtils.ts | 43 ++++++++++------------ 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/packages/cache/src/internal/uploadUtils.ts b/packages/cache/src/internal/uploadUtils.ts index efb80de1..372b2176 100644 --- a/packages/cache/src/internal/uploadUtils.ts +++ b/packages/cache/src/internal/uploadUtils.ts @@ -140,30 +140,27 @@ export async function uploadCacheArchiveSDK( onProgress: uploadProgress.onProgress() } - try { - uploadProgress.startDisplayTimer() + // try { + uploadProgress.startDisplayTimer() - core.debug( - `BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}` + core.debug( + `BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}` + ) + + const response = await blockBlobClient.uploadFile(archivePath, uploadOptions) + + // TODO: better management of non-retryable errors + if (response._response.status >= 400) { + throw new InvalidResponseError( + `Upload failed with status code ${response._response.status}` ) - - const response = await blockBlobClient.uploadFile( - archivePath, - uploadOptions - ) - - // TODO: better management of non-retryable errors - if (response._response.status >= 400) { - throw new InvalidResponseError( - `Upload failed with status code ${response._response.status}` - ) - } - - return response - } catch (error) { - core.debug(`Error uploading cache archive: ${error}`) - throw error - } finally { - uploadProgress.stopDisplayTimer() } + + return response + // } catch (error) { + // core.debug(`Error uploading cache archive: ${error}`) + // throw error + // } finally { + // uploadProgress.stopDisplayTimer() + // } }