From 501aac1868a043035c88bf1485f6bec8a4941416 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Wed, 27 Aug 2025 08:48:31 -0300 Subject: [PATCH] SIENTIAPDE-1205 Update values.yaml and refactor shutdown methods for improved configuration and async handling - Changed replica count from 2 to 1 in values.yaml for deployment optimization. - Updated image tag from 0.4.3 to 0.4.5 in values.yaml for version consistency. - Refactored shutdown method in IngestorManager to use await server.shutdown() for better async operation. - Removed __del__ method in OpcManager to prevent blocking during cleanup. --- ingestor/managers/ingestor_manager.py | 2 +- ingestor/managers/opc_manager.py | 3 --- values.yaml | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ingestor/managers/ingestor_manager.py b/ingestor/managers/ingestor_manager.py index 70b0451..12eeb10 100644 --- a/ingestor/managers/ingestor_manager.py +++ b/ingestor/managers/ingestor_manager.py @@ -114,7 +114,7 @@ class IngestorManager(BaseActivity): async def shutdown(self): for _server_name, server in self.opc_managers.items(): - await server.disconnect() + await server.shutdown() self.data_manager.shutdown() def __del__(self): diff --git a/ingestor/managers/opc_manager.py b/ingestor/managers/opc_manager.py index 7f846c4..0e307c5 100644 --- a/ingestor/managers/opc_manager.py +++ b/ingestor/managers/opc_manager.py @@ -51,9 +51,6 @@ class OpcManager(BaseActivity): except Exception as e: self.logger.error(f"Error during cleanup: {e}") - def __del__(self): - asyncio.run(self.shutdown()) - async def set_security(self): """ Configures the security settings for the OPC UA client. diff --git a/values.yaml b/values.yaml index 6c56367..fe51efb 100644 --- a/values.yaml +++ b/values.yaml @@ -3,7 +3,7 @@ # Declare variables to be passed into your templates. # This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ -replicaCount: 2 +replicaCount: 1 # This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ image: @@ -11,7 +11,7 @@ image: # This sets the pull policy for images. pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. - tag: "0.4.3" + tag: "0.4.5" # This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: @@ -139,7 +139,7 @@ env: - name: GITHUB_REPO_URL value: "git@github.com:Aignosi/sientia-dataops-opc-ingestor.git" - name: GITHUB_BRANCH - value: "SIENTIAPDE-1193-conferir-como-a-escrita-de-datetime-ocorre-no-temporal" + value: "SIENTIAPDE-1205-alterar-opc-para-assincrono" - name: PYTHON_APP value: "ingestor.app"