mirror of
https://github.com/ShadowJonathan/conduit_toolbox.git
synced 2025-07-25 21:04:08 +03:00
change flush to be on drop
This commit is contained in:
parent
c096eefa32
commit
8293beba48
1 changed files with 7 additions and 2 deletions
|
@ -66,6 +66,13 @@ impl Database for RocksDB {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Drop for RocksDB {
|
||||||
|
#[allow(unused_must_use)]
|
||||||
|
fn drop(&mut self) {
|
||||||
|
self.rocks.flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct RocksDBCF<'a> {
|
pub struct RocksDBCF<'a> {
|
||||||
db: &'a mut RocksDB,
|
db: &'a mut RocksDB,
|
||||||
name: String,
|
name: String,
|
||||||
|
@ -87,8 +94,6 @@ impl<'r> Segment for RocksDBCF<'r> {
|
||||||
self.db.rocks.put_cf(cf, key, value)?;
|
self.db.rocks.put_cf(cf, key, value)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.db.rocks.flush_cf(cf)?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue