pub fn maintenance_prune(
home: &Path,
cache_dir: &Path,
limit: u64,
) -> Result<Option<Prune>>Expand description
Prune cache_dir to limit, but only while holding the lease — a prune
that raced a live build would delete files a compile in flight still
needs, on top of confusing whatever built them about why its own output
vanished. Ok(None) when the cache is in use right now; that is not an
error, it is the janitor’s next pass catching it once the borrower is
done. Never touches a lease file itself — they live outside cache_dir
(see [leases_dir]), so crate::disk::prune_dir’s own sweep can never
reach one.