From c33724abbd6a193e7109d9c8afe087efa65d2b06 Mon Sep 17 00:00:00 2001 From: srryan Date: Wed, 20 Dec 2023 15:45:19 -0500 Subject: [PATCH] update to http client --- .../artifact/src/internal/download/download-artifact.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 110375ab..2caa92ab 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -39,13 +39,15 @@ async function exists(path: string): Promise { async function streamExtract(url: string, directory: string): Promise { let retryCount = 0 - while (retryCount < 3) { + while (retryCount < 5) { try { await streamExtractInternal(url, directory) return } catch (error) { retryCount++ - core.warning(`Failed to download artifact. Retrying...`) + core.warning(`Failed to download artifact. Retrying in 5 seconds...`) + // wait 5 seconds before retrying + await new Promise(resolve => setTimeout(resolve, 5000)) } } @@ -70,6 +72,7 @@ async function streamExtractInternal( const timeout = 30 * 1000 const timerFn = (): void => { + zipStream.end() reject(new Error(`Blob storage chunk did not respond in ${timeout}ms `)) } let timer = setTimeout(timerFn, timeout) @@ -82,6 +85,7 @@ async function streamExtractInternal( }) .pipe(zipStream) .on('close', () => { + core.debug(`zip stream: Artifact downloaded to: ${directory}`) clearTimeout(timer) resolve() })