Skip to content

Commit

Permalink
Deleting more files at once when clearing cache
Browse files Browse the repository at this point in the history
  • Loading branch information
james58899 committed Nov 19, 2024
1 parent e6d4358 commit 8c007b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cache_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,10 @@ impl CacheManager {
return;
}
dirs.sort_unstable_by(|(_, a), (_, b)| a.cmp(b));
target_dir = dirs[0].0.clone();
cut_off = dirs.get(1).map(|(_, t)| **t).unwrap_or_else(FileTime::now);
let (dir, time) = dirs[0];
target_dir = dir.clone();
// 1 day
cut_off = FileTime::from_unix_time(time.unix_seconds() + 86400, time.nanoseconds());
}

// List files
Expand Down

0 comments on commit 8c007b3

Please sign in to comment.