Skip to content

Commit

Permalink
fix: api changes for peers endpoint in bee
Browse files Browse the repository at this point in the history
  • Loading branch information
nugaon committed Oct 29, 2024
1 parent fe34c9b commit 142f53c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/command/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions src/utils/wait.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,21 @@ export async function waitForWorkers(
}

for (let i = 0; i < waitingIterations; i++) {
await sleep(AWAIT_SLEEP)

try {
const peers = await beeDebug.getPeers()

if (peers.length >= workerCount) {
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')
Expand Down

0 comments on commit 142f53c

Please sign in to comment.