SIENTIAPDE-994Add shutdown methods for Activities and OPC classes; enhance worker error handling

This commit is contained in:
vitor-aignosi
2025-05-28 08:23:50 -03:00
parent 6f81ce7d03
commit 325d22f241
4 changed files with 205 additions and 1 deletions

View File

@@ -47,3 +47,7 @@ class Activities(Postgres, MLFlow, Gates, OPC):
@activity.defn(name="prepare_activity")
async def prepare_activity(self, input_data: dict[str, Any]):
await super().prepare_activity(input_data)
def shutdown(self):
Postgres.close(self)
OPC.shutdown(self)

View File

@@ -99,3 +99,7 @@ class OPC(BaseActivity):
data_type=tag_config['data_type'],
tag_type='confidence'
)
def shutdown(self):
for opc in self.opc_repository.values():
opc.disconnect()