mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
fix: Compact the whole database for each WriteBatch injected
This commit is contained in:
parent
a45cc4b618
commit
383a49b44f
@ -266,6 +266,7 @@ impl DatabaseIndex {
|
|||||||
fn commit_update(&self, update: Update) -> Result<Arc<DatabaseView<Arc<DB>>>, Box<Error>> {
|
fn commit_update(&self, update: Update) -> Result<Arc<DatabaseView<Arc<DB>>>, Box<Error>> {
|
||||||
let batch = update.build()?;
|
let batch = update.build()?;
|
||||||
self.db.write(batch)?;
|
self.db.write(batch)?;
|
||||||
|
self.db.compact_range(None, None);
|
||||||
|
|
||||||
let snapshot = Snapshot::new(self.db.clone());
|
let snapshot = Snapshot::new(self.db.clone());
|
||||||
let view = Arc::new(DatabaseView::new(snapshot)?);
|
let view = Arc::new(DatabaseView::new(snapshot)?);
|
||||||
|
Loading…
Reference in New Issue
Block a user