Skip to content

Commit

Permalink
feat: Enhance logging in CassandraOnlineStore destructor with current…
Browse files Browse the repository at this point in the history
… timestamp
  • Loading branch information
Bhargav Dodla committed Jan 29, 2025
1 parent 334e752 commit 780bb90
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,18 +329,22 @@ def __del__(self):
you can't use the session object anymore.
You'd get a RuntimeError "cannot schedule new futures after shutdown".
"""
print(
f"{get_current_time_in_ms()} Calling CassandraOnlineStore __del__() method"
)
print("Calling CassandraOnlineStore __del__() method")
if self._session:
if not self._session.is_shutdown:
self._session.shutdown()
print(f"{get_current_time_in_ms()} Session is shutdown")
current_time_in_ms = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[
:-3
]
print(f"{current_time_in_ms} Session is shutdown")

if self._cluster:
if not self._cluster.is_shutdown:
self._cluster.shutdown()
print(f"{get_current_time_in_ms()} Cluster is shutdown")
current_time_in_ms = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[
:-3
]
print(f"{current_time_in_ms} Cluster is shutdown")

def online_write_batch_connector(
self,
Expand Down

0 comments on commit 780bb90

Please sign in to comment.