Skip to content

Commit fb70203

Browse files
author
Bhargav Dodla
committed
feat: Enhance logging in CassandraOnlineStore destructor with current timestamp
1 parent 70b62cd commit fb70203

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
@@ -332,18 +332,22 @@ def __del__(self):
332332
you can't use the session object anymore.
333333
You'd get a RuntimeError "cannot schedule new futures after shutdown".
334334
"""
335-
print(
336-
f"{get_current_time_in_ms()} Calling CassandraOnlineStore __del__() method"
337-
)
335+
print("Calling CassandraOnlineStore __del__() method")
338336
if self._session:
339337
if not self._session.is_shutdown:
340338
self._session.shutdown()
341-
print(f"{get_current_time_in_ms()} Session is shutdown")
339+
current_time_in_ms = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[
340+
:-3
341+
]
342+
print(f"{current_time_in_ms} Session is shutdown")
342343

343344
if self._cluster:
344345
if not self._cluster.is_shutdown:
345346
self._cluster.shutdown()
346-
print(f"{get_current_time_in_ms()} Cluster is shutdown")
347+
current_time_in_ms = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[
348+
:-3
349+
]
350+
print(f"{current_time_in_ms} Cluster is shutdown")
347351

348352
def online_write_batch_connector(
349353
self,

0 commit comments

Comments
 (0)