From ace85ff38c3596828d854b3e52ca6173b5c89bb2 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 24 Oct 2023 16:22:32 +0200 Subject: [PATCH] fix: close REST API server before closing network (#6061) --- packages/beacon-node/src/node/nodejs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/beacon-node/src/node/nodejs.ts b/packages/beacon-node/src/node/nodejs.ts index 6e129076848c..3c9f2ec0b54b 100644 --- a/packages/beacon-node/src/node/nodejs.ts +++ b/packages/beacon-node/src/node/nodejs.ts @@ -317,10 +317,10 @@ export class BeaconNode { this.status = BeaconNodeStatus.closing; this.sync.close(); this.backfillSync?.close(); + if (this.restApi) await this.restApi.close(); await this.network.close(); if (this.metricsServer) await this.metricsServer.close(); if (this.monitoring) this.monitoring.close(); - if (this.restApi) await this.restApi.close(); await this.chain.persistToDisk(); await this.chain.close(); if (this.controller) this.controller.abort();