From 6cb288a71b7d8700af2653ea50ecedbb43c206c4 Mon Sep 17 00:00:00 2001 From: bludnic Date: Mon, 26 Aug 2024 08:05:49 +0100 Subject: [PATCH] fix(Nodes): don't block `onStatusChange` callback --- src/lib/nodes/abstract.client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/nodes/abstract.client.ts b/src/lib/nodes/abstract.client.ts index 096efdad4..197285ae4 100644 --- a/src/lib/nodes/abstract.client.ts +++ b/src/lib/nodes/abstract.client.ts @@ -53,9 +53,6 @@ export abstract class Client { } protected async watchNodeStatusChange() { - await Promise.all(this.nodes.map((node) => node.startHealthcheck())) - this.resolve() - for (const node of this.nodes) { node.onStatusChange((nodeStatus) => { this.updateSyncStatuses() @@ -68,6 +65,9 @@ export abstract class Client { } }) } + + await Promise.all(this.nodes.map((node) => node.startHealthcheck())) + this.resolve() } /**