Skip to main content

flush_cache

Function flush_cache 

Source
pub fn flush_cache(cache_dir: &Path) -> Result<(), CacheError>
Expand description

Empties the local cache — mirrors snapdir flush-cache.

Removes the cache directory’s contents (objects and manifests). The oracle does rm -rf "${cache_dir}"; this removes the directory’s contents so the directory itself (which the caller may have created) survives, while still leaving the cache empty. Idempotent on a missing cache directory (a clean no-op pass).

§Errors

  • CacheError::Io on a removal failure other than the directory simply being absent.