Skip to content

Commit

Permalink
fix cleaner pop
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Mar 22, 2024
1 parent cd107b0 commit 7484731
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cacholote/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ def get_unknown_sizes(self, lock_validity_period: float | None) -> dict[str, int
with config.get().instantiated_sessionmaker() as session:
for cache_entry in session.scalars(sa.select(database.CacheEntry)):
for file in _get_files_from_cache_entry(cache_entry):
unknown_sizes.pop(file)
unknown_sizes.pop(file, 0)
return unknown_sizes

def delete_unknown_files(
self, lock_validity_period: float | None, recursive: bool
) -> None:
unknown_sizes = self.get_unknown_sizes(lock_validity_period)
for urlpath in unknown_sizes:
self.file_sizes.pop(urlpath)
self.file_sizes.pop(urlpath, 0)
self.remove_files(
list(unknown_sizes),
recursive=recursive,
Expand Down

0 comments on commit 7484731

Please sign in to comment.