Skip to content

Commit

Permalink
πŸš‘ Limit the cache capacity.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Nov 28, 2024
1 parent 85eac87 commit af1cef6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/database_driver_native/src/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ impl KVStore for ProxyKV {

pub async fn init_kv(path: impl ToString) -> Result<ProxyKV> {
Ok(ProxyKV {
db: sled::open(path.to_string())?,
db: sled::Config::default()
.cache_capacity(10 * 1024 * 1024) // 10 MiB
.path(path.to_string())
.open()?,
})
}

0 comments on commit af1cef6

Please sign in to comment.