Commit c32a8bf6 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[data] Add warning message when removing cache files on close

Currently there's nothing in the log so if there's an error,
the result will be a missing file error.
parent 18f947a2
......@@ -957,6 +957,15 @@ class CachedDataSink(DataSink):
if (self.last_written_data_index is None) or (
self.last_written_data_index < self.end_index
):
if self.last_written_data_index is None:
message = "No data written"
else:
message = "No enough data written: last written {} vs end {}".format(
self.last_data_index, self.end_index
)
logger.warning("Removing cache files: {}".format(message))
try:
os.remove(self.filename)
os.remove(self.filename.replace(".data", ".index"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment