Skip to content

Commit

Permalink
Merge pull request #19 from imubit/prevent-duplicate-connection-manag…
Browse files Browse the repository at this point in the history
…er-termination

fix: connection_manager duplicate termination
  • Loading branch information
cloud-rocket authored May 2, 2024
2 parents 3a7bd71 + cff12d3 commit 595e0e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/data_agent/connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 595e0e3

Please sign in to comment.