fix: move back to sled stable

This commit is contained in:
Timo Kösters 2021-04-11 10:12:05 +02:00
parent 84f4ce73e5
commit 044e65afcc
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
4 changed files with 68 additions and 74 deletions

View file

@ -108,7 +108,7 @@ impl Database {
pub async fn load_or_create(config: Config) -> Result<Self> {
let db = sled::Config::default()
.path(&config.database_path)
.cache_capacity(config.cache_capacity as usize)
.cache_capacity(config.cache_capacity as u64)
.use_compression(true)
.open()?;
@ -301,7 +301,8 @@ impl Database {
}
pub async fn flush(&self) -> Result<()> {
self._db.flush_async().await?;
// noop while we don't use sled 1.0
//self._db.flush_async().await?;
Ok(())
}
}

View file

@ -211,10 +211,12 @@ impl Sending {
};
},
Some(event) = &mut subscriber => {
for (_tree, key, value_opt) in &event {
if value_opt.is_none() {
continue;
}
if let sled::Event::Insert { key, .. } = event {
// New sled version:
//for (_tree, key, value_opt) in &event {
// if value_opt.is_none() {
// continue;
// }
let servernamepduid = key.clone();