mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
Apply review suggestions and stop using rtxn.commit
This commit is contained in:
parent
17cd2a4aa0
commit
11fee30f47
@ -686,8 +686,7 @@ impl IndexScheduler {
|
|||||||
| IndexOperation::DocumentClear { ref index_uid, .. } => {
|
| IndexOperation::DocumentClear { ref index_uid, .. } => {
|
||||||
// only get the index, don't create it
|
// only get the index, don't create it
|
||||||
let rtxn = self.env.read_txn()?;
|
let rtxn = self.env.read_txn()?;
|
||||||
let r = self.index_mapper.index(&rtxn, index_uid)?;
|
self.index_mapper.index(&rtxn, index_uid)?
|
||||||
r
|
|
||||||
}
|
}
|
||||||
IndexOperation::DocumentImport { ref index_uid, allow_index_creation, .. }
|
IndexOperation::DocumentImport { ref index_uid, allow_index_creation, .. }
|
||||||
| IndexOperation::Settings { ref index_uid, allow_index_creation, .. }
|
| IndexOperation::Settings { ref index_uid, allow_index_creation, .. }
|
||||||
@ -701,8 +700,7 @@ impl IndexScheduler {
|
|||||||
index
|
index
|
||||||
} else {
|
} else {
|
||||||
let rtxn = self.env.read_txn()?;
|
let rtxn = self.env.read_txn()?;
|
||||||
let r = self.index_mapper.index(&rtxn, index_uid)?;
|
self.index_mapper.index(&rtxn, index_uid)?
|
||||||
r
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -718,7 +718,7 @@ impl IndexScheduler {
|
|||||||
Some(batch) => batch,
|
Some(batch) => batch,
|
||||||
None => return Ok(0),
|
None => return Ok(0),
|
||||||
};
|
};
|
||||||
drop(rtxn); //rtxn.commit()?;
|
drop(rtxn);
|
||||||
|
|
||||||
// 1. store the starting date with the bitmap of processing tasks.
|
// 1. store the starting date with the bitmap of processing tasks.
|
||||||
let mut ids = batch.ids();
|
let mut ids = batch.ids();
|
||||||
|
@ -80,8 +80,6 @@ pub fn snapshot_index_scheduler(scheduler: &IndexScheduler) -> String {
|
|||||||
snap.push_str(&snapshot_file_store(file_store));
|
snap.push_str(&snapshot_file_store(file_store));
|
||||||
snap.push_str("\n----------------------------------------------------------------------\n");
|
snap.push_str("\n----------------------------------------------------------------------\n");
|
||||||
|
|
||||||
rtxn.commit().unwrap();
|
|
||||||
|
|
||||||
snap
|
snap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user