From 1512ca98bdc9b97e41fd5c25d9904f33fc21493d Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Tue, 8 Jul 2025 12:32:21 -0300 Subject: [PATCH] SIENTIAPDE-1110 Refactor OpcManager to improve node subscription handling - Simplified the address node assignment in the OpcManager class by directly using a local variable instead of an instance variable. - Enhanced debug logging to provide clearer insights into the nodes being subscribed to. --- ingestor/managers/opc_manager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ingestor/managers/opc_manager.py b/ingestor/managers/opc_manager.py index 9e1cff9..cba0286 100644 --- a/ingestor/managers/opc_manager.py +++ b/ingestor/managers/opc_manager.py @@ -157,9 +157,9 @@ class OpcManager(): self.logger.info(f"Subscribing to {subscription} on {self.name}...") self.logger.info(f"Subscribing to nodes: {nodes}") - self.addr_nodes = [self.client.get_node( - n) for n in nodes if n not in self.nodes] - self.logger.debug(f"Addr nodes: {self.addr_nodes}") + addr_nodes = [self.client.get_node( + n) for n in nodes] + self.logger.debug(f"Addr nodes: {addr_nodes}") self.nodes.update(nodes) self.logger.debug(f"Nodes: {self.nodes}") metrics.OPC_TAGS_SUBSCRIBED.labels( @@ -172,7 +172,7 @@ class OpcManager(): 'cycle_count': 0 } - self.subscriptions[subscription].subscribe_data_change(self.addr_nodes) + self.subscriptions[subscription].subscribe_data_change(addr_nodes) def unsubscribe(self, subscription: str): """