mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 07:56:28 +00:00 
			
		
		
		
	Do not commit transaction on failed updates
This commit is contained in:
		| @@ -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()) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user