From 6df2ba93a9b5f9b38f90251bf66b465448a7d662 Mon Sep 17 00:00:00 2001 From: Tamo Date: Thu, 6 Apr 2023 17:12:43 +0200 Subject: [PATCH] remove one useless txn --- index-scheduler/src/batch.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 87f93b399..c88234809 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -1489,10 +1489,9 @@ impl IndexScheduler { fn delete_document_by_filter(filter: &serde_json::Value, index: Index) -> Result { let filter = Filter::from_json(filter)?; Ok(if let Some(filter) = filter { - let index_rtxn = index.read_txn()?; - - let candidates = filter.evaluate(&index_rtxn, &index)?; let mut wtxn = index.write_txn()?; + + let candidates = filter.evaluate(&wtxn, &index)?; let mut delete_operation = DeleteDocuments::new(&mut wtxn, &index)?; delete_operation.delete_documents(&candidates); let deleted_documents =