mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 06:44:27 +01:00
Do not commit transaction on failed updates
This commit is contained in:
parent
ed783b67ca
commit
6a691db7f8
@ -202,7 +202,9 @@ impl Index {
|
|||||||
Ok(UpdateResult::DocumentDeletion { deleted })
|
Ok(UpdateResult::DocumentDeletion { deleted })
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
txn.commit()?;
|
if result.is_ok() {
|
||||||
|
txn.commit()?;
|
||||||
|
}
|
||||||
result
|
result
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
@ -276,8 +276,6 @@ impl IndexController {
|
|||||||
let index = self.index_resolver.create_index(name, None).await?;
|
let index = self.index_resolver.create_index(name, None).await?;
|
||||||
let update_result =
|
let update_result =
|
||||||
UpdateMsg::update(&self.update_sender, index.uuid, update).await?;
|
UpdateMsg::update(&self.update_sender, index.uuid, update).await?;
|
||||||
// ignore if index creation fails now, since it may already have been created
|
|
||||||
|
|
||||||
Ok(update_result)
|
Ok(update_result)
|
||||||
} else {
|
} else {
|
||||||
Err(IndexResolverError::UnexistingIndex(name).into())
|
Err(IndexResolverError::UnexistingIndex(name).into())
|
||||||
|
Loading…
Reference in New Issue
Block a user