616: Introduce an indexation abortion function when indexing documents r=Kerollmops a=Kerollmops



Co-authored-by: Kerollmops <clement@meilisearch.com>
Co-authored-by: Clément Renault <clement@meilisearch.com>
This commit is contained in:
bors[bot] 2022-10-26 11:41:18 +00:00 committed by GitHub
commit c8f16530d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 414 additions and 136 deletions

View file

@ -239,7 +239,7 @@ impl Performer for DocumentAddition {
if let Some(primary) = self.primary {
let mut builder = update::Settings::new(&mut txn, &index, &config);
builder.set_primary_key(primary);
builder.execute(|_| ()).unwrap();
builder.execute(|_| (), || false).unwrap();
}
let indexing_config = IndexDocumentsConfig {
@ -260,6 +260,7 @@ impl Performer for DocumentAddition {
&config,
indexing_config,
|step| indexing_callback(step, &bars),
|| false,
)
.unwrap();
let (addition, user_error) = addition.add_documents(reader)?;
@ -517,7 +518,7 @@ impl Performer for SettingsUpdate {
bars.push(bar);
}
update.execute(|step| indexing_callback(step, &bars))?;
update.execute(|step| indexing_callback(step, &bars), || false)?;
txn.commit()?;
Ok(())