Skip to content

Commit

Permalink
fix: Add null checks for session and cluster before shutdown in Cassa…
Browse files Browse the repository at this point in the history
…ndraOnlineStore
  • Loading branch information
Bhargav Dodla committed Jan 16, 2025
1 parent 268f794 commit 0c2e97c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ def shutdown(self):
"""
Shutdown the Cassandra cluster and session.
"""
if not self._session.is_shutdown:
self._session.shutdown()
if not self._cluster.is_shutdown:
self._cluster.shutdown()
if self._session:
if not self._session.is_shutdown:
self._session.shutdown()
if self._cluster:
if not self._cluster.is_shutdown:
self._cluster.shutdown()

def _get_cluster(self, config: RepoConfig):
"""
Expand Down

0 comments on commit 0c2e97c

Please sign in to comment.