From 2e463d34864f2185d68c5809d5590cd64dd5b38d Mon Sep 17 00:00:00 2001 From: Robert Field Date: Fri, 23 Aug 2024 19:00:34 +0100 Subject: [PATCH 1/2] fix: correct attempts --- .../tasks/setup-klevu-custom-api-entry-tasks.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/composable-cli/src/commands/integration/klevu/tasks/setup-klevu-custom-api-entry-tasks.ts b/packages/composable-cli/src/commands/integration/klevu/tasks/setup-klevu-custom-api-entry-tasks.ts index da024563..00162e5f 100644 --- a/packages/composable-cli/src/commands/integration/klevu/tasks/setup-klevu-custom-api-entry-tasks.ts +++ b/packages/composable-cli/src/commands/integration/klevu/tasks/setup-klevu-custom-api-entry-tasks.ts @@ -26,14 +26,16 @@ export async function setupKlevuCustomApiEntryTasks( task: async () => { // Wait for the klevu custom api to be created by the integration const customApi = await backOff( - () => fetchCustomApi(ctx.requester, "klevu-keys"), + () => + fetchCustomApi(ctx.requester, "klevu-keys").then((res) => { + if (res === null) { + throw new Error("Result was null") + } + return res + }), { startingDelay: 2000, - maxDelay: 60000, - retry: (result) => { - // Retry if the result is null - return result === null - }, + numOfAttempts: 5, }, ) From 2e3d98fbc4e7ca49d637ac735dc59a5520a10329 Mon Sep 17 00:00:00 2001 From: Robert Field Date: Fri, 23 Aug 2024 19:01:02 +0100 Subject: [PATCH 2/2] chore: add changeset --- .changeset/funny-trees-fetch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/funny-trees-fetch.md diff --git a/.changeset/funny-trees-fetch.md b/.changeset/funny-trees-fetch.md new file mode 100644 index 00000000..220ac640 --- /dev/null +++ b/.changeset/funny-trees-fetch.md @@ -0,0 +1,5 @@ +--- +"composable-cli": patch +--- + +Correct timeout used