From 7191e57aeaa864dafa0b5be331b040a82b9ecd73 Mon Sep 17 00:00:00 2001 From: "p.vanderwilt" Date: Thu, 31 Jul 2025 14:57:38 +0200 Subject: [PATCH] Improved reactor registration --- src/helper/childRegistrationUtils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/helper/childRegistrationUtils.js b/src/helper/childRegistrationUtils.js index 1d1a723..3ba661a 100644 --- a/src/helper/childRegistrationUtils.js +++ b/src/helper/childRegistrationUtils.js @@ -234,18 +234,20 @@ class ChildRegistrationUtils { return; } - // this is poor code, it should be fixed at some point if (this.mainClass?.upstreamReactor){ this.mainClass.upstreamReactor = reactor; // Add reactor to the main class - } else { + this.logger.info(`Upstream reactor registered successfully.`); + } + + if (this.mainClass?.reactors) { if (positionVsParent == "downstream") { this.mainClass.reactors[0] = reactor; } if (positionVsParent == "upstream") { this.mainClass.reactors[1] = reactor; } + this.logger.info(`Reactor registered successfully.`); } - this.logger.info(`Reactor registered successfully.`); reactor.emitter.on("stateChange", (data) => { this.mainClass.logger.debug(`State change of upstream reactor detected.`);