Skip to content

Commit

Permalink
Allow interrupting multi-index creation more often (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jan 1, 2022
1 parent 235a27a commit f223ecb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-pack/src/multi_index/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ pub mod integrity {
Fan { index: usize },
#[error("The multi-index claims to have no objects")]
Empty,
#[error("Interrupted")]
Interrupted,
}

/// Returned by [`multi_index::File::verify_integrity()`][crate::multi_index::File::verify_integrity()].
Expand Down Expand Up @@ -203,6 +205,9 @@ impl File {
}
offsets_progress.inc();
}
if should_interrupt.load(std::sync::atomic::Ordering::Relaxed) {
return Err(crate::index::traverse::Error::Processor(integrity::Error::Interrupted));
}
}

total_objects_checked += multi_index_entries_to_check.len();
Expand Down

0 comments on commit f223ecb

Please sign in to comment.