From 142f53c2164efca827f69ff0c0db66fe1e28bc2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Levente=20T=C3=B3th?= Date: Tue, 29 Oct 2024 15:11:56 +0100 Subject: [PATCH] fix: api changes for peers endpoint in bee --- src/command/start.ts | 2 +- src/utils/wait.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/command/start.ts b/src/command/start.ts index 0d4fa75..91e3c1b 100644 --- a/src/command/start.ts +++ b/src/command/start.ts @@ -260,7 +260,7 @@ export class Start extends RootCommand implements LeafCommand { await waitForWorkers(this.workers, docker.getAllStatus.bind(docker)) workerSpinner.succeed('Worker nodes are up and listening') } catch (e) { - workerSpinner.fail(`Impossible to start worker nodes!`) + workerSpinner.fail(`Impossible to start worker nodes! ${(e as Error).message}`) await this.stopDocker(docker) throw e } diff --git a/src/utils/wait.ts b/src/utils/wait.ts index 547ed26..5fc4094 100644 --- a/src/utils/wait.ts +++ b/src/utils/wait.ts @@ -107,8 +107,6 @@ export async function waitForWorkers( } for (let i = 0; i < waitingIterations; i++) { - await sleep(AWAIT_SLEEP) - try { const peers = await beeDebug.getPeers() @@ -116,12 +114,14 @@ export async function waitForWorkers( return } } catch (e) { - if ((e as { message: string }).message.includes('404')) { - // TODO remove when https://github.com/ethersphere/bee/issues/4734 is fixed + if ((e as { message: string }).message.includes('503')) { + // expexted } else if (!isAllowedError(e as FetchError)) { throw e } } + + await sleep(AWAIT_SLEEP) } throw new TimeoutError('Waiting for worker nodes timed-out')