Skip to content

Commit

Permalink
Clean cache dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 27, 2024
1 parent 46280d2 commit 14994c8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/cli/src/commands/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,18 @@ pub async fn internal_clean(
);
}

debug!("Cleaning cache directory...");

let results =
fs::remove_dir_stale_contents(&session.env.store.cache_dir, Duration::from_secs(86400))?;

if log && results.files_deleted > 0 {
println!(
"Successfully cleaned {} cache files ({} bytes)",
results.files_deleted, results.bytes_saved
);
}

Ok(None)
}

Expand Down

0 comments on commit 14994c8

Please sign in to comment.