Skip to content

Commit

Permalink
refactor(beacon-node): move initialization out of conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Jul 25, 2023
1 parent ed52b23 commit b667dee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/beacon-node/src/network/core/networkCoreWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,11 @@ new AsyncIterableBridgeHandler(getReqRespBridgeReqEvents(reqRespBridgeEventBus),
);
const reqRespBridgeRespCaller = new AsyncIterableBridgeCaller(getReqRespBridgeRespEvents(reqRespBridgeEventBus));

let networkCoreWorkerMetrics: NetworkCoreWorkerMetrics | null = null;
const networkCoreWorkerMetrics = metricsRegister ? getNetworkCoreWorkerMetrics(metricsRegister) : null;
// respBridgeCaller metrics
if (metricsRegister) {
networkCoreWorkerMetrics = getNetworkCoreWorkerMetrics(metricsRegister);
if (networkCoreWorkerMetrics) {
networkCoreWorkerMetrics.reqRespBridgeRespCallerPending.addCollect(() => {
networkCoreWorkerMetrics?.reqRespBridgeRespCallerPending.set(reqRespBridgeRespCaller.pendingCount);
networkCoreWorkerMetrics.reqRespBridgeRespCallerPending.set(reqRespBridgeRespCaller.pendingCount);
});
}

Expand Down

0 comments on commit b667dee

Please sign in to comment.