mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-22 20:50:04 +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 })
|
||||
}
|
||||
};
|
||||
txn.commit()?;
|
||||
if result.is_ok() {
|
||||
txn.commit()?;
|
||||
}
|
||||
result
|
||||
})();
|
||||
|
||||
|
@ -276,8 +276,6 @@ impl IndexController {
|
||||
let index = self.index_resolver.create_index(name, None).await?;
|
||||
let update_result =
|
||||
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)
|
||||
} else {
|
||||
Err(IndexResolverError::UnexistingIndex(name).into())
|
||||
|
Loading…
x
Reference in New Issue
Block a user