Skip to main content

collect_garbage

Function collect_garbage 

Source
pub async fn collect_garbage(
    storage: &dyn StorageBackend,
    roots: &[String],
) -> Result<GcResult, CacheError>
Expand description

Run garbage collection on the cache.

Enumerates all narinfo hashes in the storage backend, keeps those present in roots, and deletes the rest.

roots contains the 32-character store path hashes that should be kept.