From 11fee30f47500426d09e61ecb291547e35bca960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Wed, 19 Oct 2022 07:34:10 +0200 Subject: [PATCH] Apply review suggestions and stop using rtxn.commit --- index-scheduler/src/batch.rs | 6 ++---- index-scheduler/src/lib.rs | 2 +- index-scheduler/src/snapshot.rs | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 945f47eef..ff2e5ab4b 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -686,8 +686,7 @@ impl IndexScheduler { | IndexOperation::DocumentClear { ref index_uid, .. } => { // only get the index, don't create it let rtxn = self.env.read_txn()?; - let r = self.index_mapper.index(&rtxn, index_uid)?; - r + self.index_mapper.index(&rtxn, index_uid)? } IndexOperation::DocumentImport { ref index_uid, allow_index_creation, .. } | IndexOperation::Settings { ref index_uid, allow_index_creation, .. } @@ -701,8 +700,7 @@ impl IndexScheduler { index } else { let rtxn = self.env.read_txn()?; - let r = self.index_mapper.index(&rtxn, index_uid)?; - r + self.index_mapper.index(&rtxn, index_uid)? } } }; diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index 42a5f38b7..234ff7451 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -718,7 +718,7 @@ impl IndexScheduler { Some(batch) => batch, None => return Ok(0), }; - drop(rtxn); //rtxn.commit()?; + drop(rtxn); // 1. store the starting date with the bitmap of processing tasks. let mut ids = batch.ids(); diff --git a/index-scheduler/src/snapshot.rs b/index-scheduler/src/snapshot.rs index 13ad68631..66253a6ae 100644 --- a/index-scheduler/src/snapshot.rs +++ b/index-scheduler/src/snapshot.rs @@ -80,8 +80,6 @@ pub fn snapshot_index_scheduler(scheduler: &IndexScheduler) -> String { snap.push_str(&snapshot_file_store(file_store)); snap.push_str("\n----------------------------------------------------------------------\n"); - rtxn.commit().unwrap(); - snap }