flush the dump-writer only once everything has been inserted

This commit is contained in:
Tamo 2022-10-17 17:04:52 +02:00 committed by Clément Renault
parent b87b071718
commit 8e469d8d1d
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
3 changed files with 32 additions and 7 deletions

View file

@ -382,6 +382,7 @@ pub(crate) mod test {
for document in &documents {
index.push_document(document).unwrap();
}
index.flush().unwrap();
index.settings(&settings).unwrap();
// ========== pushing the task queue
@ -396,6 +397,7 @@ pub(crate) mod test {
}
}
}
task_queue.flush().unwrap();
// ========== pushing the api keys
let api_keys = create_test_api_keys();
@ -404,6 +406,7 @@ pub(crate) mod test {
for key in &api_keys {
keys.push_key(key).unwrap();
}
keys.flush().unwrap();
// create the dump
let mut file = tempfile::tempfile().unwrap();