Skip to content

Commit 780bb90

Browse files
author
Bhargav Dodla
committed
feat: Enhance logging in CassandraOnlineStore destructor with current timestamp
1 parent 334e752 commit 780bb90

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,18 +329,22 @@ def __del__(self):
329329
you can't use the session object anymore.
330330
You'd get a RuntimeError "cannot schedule new futures after shutdown".
331331
"""
332-
print(
333-
f"{get_current_time_in_ms()} Calling CassandraOnlineStore __del__() method"
334-
)
332+
print("Calling CassandraOnlineStore __del__() method")
335333
if self._session:
336334
if not self._session.is_shutdown:
337335
self._session.shutdown()
338-
print(f"{get_current_time_in_ms()} Session is shutdown")
336+
current_time_in_ms = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[
337+
:-3
338+
]
339+
print(f"{current_time_in_ms} Session is shutdown")
339340

340341
if self._cluster:
341342
if not self._cluster.is_shutdown:
342343
self._cluster.shutdown()
343-
print(f"{get_current_time_in_ms()} Cluster is shutdown")
344+
current_time_in_ms = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[
345+
:-3
346+
]
347+
print(f"{current_time_in_ms} Cluster is shutdown")
344348

345349
def online_write_batch_connector(
346350
self,

0 commit comments

Comments
 (0)