Skip to main content

index_with_options

Function index_with_options 

Source
pub async fn index_with_options(
    root: &Path,
    src: &Path,
    repo: &str,
    view: &str,
    opts: &IndexOptions,
) -> Result<(IndexSummary, Option<GcSummary>)>
Expand description

index the (repo, view) view, then — when opts.gc_after — sweep unreferenced blobs. The opt-in post-index trigger of gonzalo#104: the sweep runs only after a successful index and always goes through gc, which marks against every record in the store (never a per-view subset), so a slice the just-indexed view dropped but another view still references is preserved.

The optional knobs ride in IndexOptions rather than as positional arguments, so adding one is a field rather than an edit at every layer between here and the call sites (#331).