From 903f3317edf64cb04ebc20a73a591e20211c6865 Mon Sep 17 00:00:00 2001 From: Tejas Kumar Date: Wed, 19 May 2021 10:59:41 +0200 Subject: [PATCH] Retry only on fail lol Signed-off-by: Tejas Kumar --- .../src/scaffolder/stages/publish/helpers.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/publish/helpers.ts b/plugins/scaffolder-backend/src/scaffolder/stages/publish/helpers.ts index 6874efe06a..79c93128c6 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/publish/helpers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/publish/helpers.ts @@ -109,9 +109,9 @@ export const enableBranchProtectionOnDefaultRepoBranch = async ({ if (!e.message.includes('Branch not found')) { throw e; } - } - // GitHub has eventual consistency. Fail silently, wait, and try again. - await new Promise(resolve => setTimeout(resolve, 600)); - await tryOnce(); + // GitHub has eventual consistency. Fail silently, wait, and try again. + await new Promise(resolve => setTimeout(resolve, 600)); + await tryOnce(); + } };