From 4c0f556a649829e7ffd728861c1c9562efe35fc4 Mon Sep 17 00:00:00 2001 From: james58899 Date: Mon, 18 Nov 2024 14:24:45 +0000 Subject: [PATCH] Try deleting more files at once when clearing cache --- src/cache_manager.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cache_manager.rs b/src/cache_manager.rs index 83e156b..6c0b4aa 100644 --- a/src/cache_manager.rs +++ b/src/cache_manager.rs @@ -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