kv & sqlite: fix paths

This commit is contained in:
bitful-pannul 2023-12-20 18:25:23 -03:00
parent 060a0a0a94
commit 995f6738ef
2 changed files with 6 additions and 6 deletions

View File

@ -414,8 +414,7 @@ async fn check_caps(
)
.await?;
let db_path = format!("{}{}", kv_path, request.db.to_string());
let db_path = format!("{}/{}/{}", kv_path, request.package_id.to_string(), request.db.to_string());
fs::create_dir_all(&db_path).await?;
let db = OptimisticTransactionDB::open_default(&db_path)?;

View File

@ -428,12 +428,13 @@ async fn check_caps(
)
.await?;
let db_path = format!("{}{}", sqlite_path, request.db.to_string());
let db_path = format!("{}/{}/{}", sqlite_path, request.package_id.to_string(), request.db.to_string());
fs::create_dir_all(&db_path).await?;
let db = Connection::open(&db_path)?;
db.execute("PRAGMA journal_mode=WAL;", [])?;
let db_file_path = format!("{}/{}.db", db_path, request.db.to_string());
let db = Connection::open(&db_file_path)?;
let _ = db.execute("PRAGMA journal_mode=WAL", []);
open_dbs.insert(
(request.package_id.clone(), request.db.clone()),