mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 14:54:27 +01:00
Merge pull request #233 from meilisearch/commit-when-update-ok
Commit an update only when it is Ok
This commit is contained in:
commit
8d9d183ce6
@ -35,8 +35,10 @@ fn update_awaiter(receiver: Receiver<()>, env: heed::Env, update_fn: Arc<ArcSwap
|
|||||||
|
|
||||||
match update::update_task(&mut writer, index.clone()) {
|
match update::update_task(&mut writer, index.clone()) {
|
||||||
Ok(Some(status)) => {
|
Ok(Some(status)) => {
|
||||||
if let Err(e) = writer.commit() {
|
if status.result.is_ok() {
|
||||||
error!("update transaction failed: {}", e)
|
if let Err(e) = writer.commit() {
|
||||||
|
error!("update transaction failed: {}", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(ref callback) = *update_fn.load() {
|
if let Some(ref callback) = *update_fn.load() {
|
||||||
|
Loading…
Reference in New Issue
Block a user