Skip to content

Commit 4086869

Browse files
authored
Bad overriding of thread._delete (#278)
1 parent b0f04da commit 4086869

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/litdata/streaming/reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def delete(self, chunk_indexes: List[int]) -> None:
8484
for chunk_index in chunk_indexes:
8585
self._to_delete_queue.put(chunk_index)
8686

87-
def _delete(self, chunk_index: int) -> None:
87+
def _apply_delete(self, chunk_index: int) -> None:
8888
"""Inform the item loader of the chunk to delete."""
8989
if self._config.can_delete(chunk_index):
9090
chunk_filepath, _, _ = self._config[ChunkedIndex(index=-1, chunk_index=chunk_index)]
@@ -118,7 +118,7 @@ def _maybe_delete_chunks(self) -> None:
118118
# Get the current cache size and decide whether we need to start cleanup. Otherwise, keep track of it
119119
while self._max_cache_size and self._chunks_index_to_be_deleted and self._can_delete_chunk():
120120
# Delete the oldest chunk
121-
self._delete(self._chunks_index_to_be_deleted.pop(0))
121+
self._apply_delete(self._chunks_index_to_be_deleted.pop(0))
122122

123123
return
124124

0 commit comments

Comments
 (0)