Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use low level API to configure the API #232

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion coffee_storage/src/nosql_db.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use async_trait::async_trait;
use coffee_lib::utils::check_dir_or_make_if_missing;
use nosql_db::NoSQL;
use nosql_sled::sled;
use nosql_sled::SledDB;

use coffee_lib::error;
Expand All @@ -17,7 +18,8 @@ impl NoSQlStorage {
pub async fn new(path: &str) -> Result<Self, CoffeeError> {
let path = format!("{path}/storage");
check_dir_or_make_if_missing(path.clone()).await?;
let db = SledDB::new(&path).map_err(|err| error!("{err}"))?;
let config = sled::Config::new().path(path).cache_capacity(1_000_000);
let db = SledDB::try_from(config).map_err(|err| error!("{err}"))?;
Ok(Self { inner: db })
}
}
Expand Down
Loading