SIENTIAPDE-1082
Implement shutdown methods for Activities and Kafka; enhance error handling in worker main function
This commit is contained in:
@@ -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]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user