From 80d22c042f326cc531e8a9315edbcc1e82e0f8f8 Mon Sep 17 00:00:00 2001 From: Daniel Amar Date: Tue, 27 May 2025 13:53:26 -0400 Subject: [PATCH] remove retry only on certain errors. maxRetries set to 3 instead of 5. --- src/main.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/main.ts b/src/main.ts index ce83109..f9cdeb5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -48,15 +48,6 @@ async function retryWithBackoff( } } -/** - * Check if an error is a buildkit socket connection error - */ -function isBuildkitSocketError(error: Error): boolean { - return error.message.includes('/run/buildkit/buildkitd.sock') || - error.message.includes('failed to list workers') || - error.message.includes('connection error'); -} - actionsToolkit.run( // main async () => { @@ -230,14 +221,9 @@ actionsToolkit.run( // If the command takes too long, we'll get the timeout error instead return Promise.race([execPromise, timeoutPromise]); }, - 5, // maxRetries - retry up to 5 times for buildkit initialization + 3, // maxRetries - retry up to 3 times for buildkit initialization 1000, // initialDelay - start with 1 second - 15000, // maxDelay - cap at 15 seconds - (error) => { - // Retry on buildkit socket errors or timeouts - return isBuildkitSocketError(error) || - error.message.includes('Timeout exceeded while waiting for buildkit'); - } + 15000 // maxDelay - cap at 15 seconds ); } catch (error) { // Log the warning but continue - this matches current behavior where builds still succeed