fix: Flush the database after each WriteBatch injected

This commit is contained in:
Clément Renault 2019-03-04 15:01:38 +01:00
parent 383a49b44f
commit aae301878c
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE

View File

@ -267,6 +267,7 @@ impl DatabaseIndex {
let batch = update.build()?; let batch = update.build()?;
self.db.write(batch)?; self.db.write(batch)?;
self.db.compact_range(None, None); self.db.compact_range(None, None);
self.db.flush(true)?;
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)?);