SIENTIAPDE-1082

Implement shutdown methods for Activities and Kafka; enhance error handling in worker main function
This commit is contained in:
vitor-aignosi
2025-06-09 15:09:53 -03:00
parent b8beb0e151
commit 8cf3273714
3 changed files with 25 additions and 1 deletions

View File

@@ -25,6 +25,14 @@ class Kafka(BaseActivity):
BaseActivity.__init__(self, logger, notification_handler)
def close(self):
"""Closes the connector connection."""
self.logger.info("Closing Kafka connector...")
self.kafka_connector.close()
def __del__(self):
self.close()
@activity.defn(name="load_from_kafka")
async def load_from_kafka(self, input_data: dict[str, Any]) -> dict[str, Any]:
"""