aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-03 14:00:13 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-03 14:00:13 +0200
commitd3d7df098b4188ea26d3cec29f2cc226d55d783e (patch)
tree35d6ab41aed5a14e456b20169563fd59bc1a8758
parent3d18c9e183a1062d797a9cf1a9a6e3b1e6ae7853 (diff)
downloadgarage-d3d7df098b4188ea26d3cec29f2cc226d55d783e.tar.gz
garage-d3d7df098b4188ea26d3cec29f2cc226d55d783e.zip
small fixes
-rw-r--r--src/block/rc.rs4
-rw-r--r--src/garage/server.rs5
2 files changed, 3 insertions, 6 deletions
diff --git a/src/block/rc.rs b/src/block/rc.rs
index f6d8c2aa..7d85f67e 100644
--- a/src/block/rc.rs
+++ b/src/block/rc.rs
@@ -26,9 +26,7 @@ impl BlockRc {
Some(x) => {
tx.insert(&self.rc, &hash, x)?;
}
- None => {
- tx.remove(&self.rc, &hash)?;
- }
+ None => unreachable!(),
};
tx.commit(old_rc)
})?;
diff --git a/src/garage/server.rs b/src/garage/server.rs
index bd34456d..a56f124a 100644
--- a/src/garage/server.rs
+++ b/src/garage/server.rs
@@ -32,9 +32,9 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> {
let config = read_config(config_file).expect("Unable to read config file");
info!("Opening database...");
+ let mut db_path = config.metadata_dir.clone();
let db = match config.db_engine.as_str() {
"sled" => {
- let mut db_path = config.metadata_dir.clone();
db_path.push("db");
let db = db::sled_adapter::sled::Config::default()
.path(&db_path)
@@ -44,8 +44,7 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> {
.expect("Unable to open sled DB");
db::sled_adapter::SledDb::init(db)
}
- "sqlite" => {
- let mut db_path = config.metadata_dir.clone();
+ "sqlite" | "sqlite3" | "rusqlite" => {
db_path.push("db.sqlite");
let db = db::sqlite_adapter::rusqlite::Connection::open(db_path)
.expect("Unable to open sqlite DB");