SIENTIAPDE-994Add shutdown methods for Activities and OPC classes; enhance worker error handling
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user