From cff12d3e1388d7b533568d1c8f6c127cb733aca2 Mon Sep 17 00:00:00 2001 From: Meir Tseitlin Date: Wed, 6 Dec 2023 16:19:41 -0600 Subject: [PATCH] fix: connection_manager duplicate termination --- src/data_agent/connection_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/data_agent/connection_manager.py b/src/data_agent/connection_manager.py index c7e86f0..aa18459 100644 --- a/src/data_agent/connection_manager.py +++ b/src/data_agent/connection_manager.py @@ -82,10 +82,15 @@ def __del__(self): self.close() def close(self): + if not self._connector_classes: + return + # Remove connections, but not from persistance existing_connections = list(self._connections_map.keys()) for conn in existing_connections: self._delete_connection(conn) + + self._connector_classes = None log.info("ConnectionManager terminated successfully.") def reset(self):