aboutsummaryrefslogtreecommitdiff
path: root/cache/src/lib.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-12-11 03:25:56 +0100
committermetamuffin <metamuffin@disroot.org>2025-12-11 03:25:56 +0100
commit214b78c581319ee012383134107fa5c371febe09 (patch)
tree6d775bbeb54a78c1acc32694dda4b7c21e94219e /cache/src/lib.rs
parentcd8a77b37fff75d7f2c3e96cf8a58598936b4e04 (diff)
downloadjellything-214b78c581319ee012383134107fa5c371febe09.tar
jellything-214b78c581319ee012383134107fa5c371febe09.tar.bz2
jellything-214b78c581319ee012383134107fa5c371febe09.tar.zst
rocksdb cache backend
Diffstat (limited to 'cache/src/lib.rs')
-rw-r--r--cache/src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/cache/src/lib.rs b/cache/src/lib.rs
index 20e1424..d68266f 100644
--- a/cache/src/lib.rs
+++ b/cache/src/lib.rs
@@ -6,7 +6,7 @@
mod backends;
mod helper;
-use crate::backends::{CacheStorage, filesystem::Filesystem};
+use crate::backends::{CacheStorage, init_backend};
use anyhow::{Context, Result, anyhow};
use log::{info, warn};
use serde::{Deserialize, Serialize};
@@ -26,6 +26,7 @@ pub use helper::{EscapeKey, HashKey};
#[derive(Debug, Deserialize)]
pub struct Config {
+ driver: String,
path: PathBuf,
max_in_memory_cache_size: usize,
}
@@ -49,7 +50,7 @@ static CACHE_STORE: OnceLock<Box<dyn CacheStorage>> = OnceLock::new();
pub fn init_cache() -> Result<()> {
CACHE_STORE
- .set(Box::new(Filesystem::new(&CONF)))
+ .set(init_backend().context("cache backend")?)
.map_err(|_| ())
.unwrap();
Ok(())