mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-22 08:01:47 +03:00
fixes
This commit is contained in:
parent
b87cfbc674
commit
03b531ef64
@ -48,6 +48,9 @@ impl KvState {
|
||||
pub async fn open_db(&mut self, package_id: PackageId, db: String) -> Result<(), KvError> {
|
||||
let key = (package_id.clone(), db.clone());
|
||||
if self.open_kvs.contains_key(&key) {
|
||||
let mut access_order = self.access_order.lock().await;
|
||||
access_order.remove(&key);
|
||||
access_order.push_back(key);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@ -497,10 +500,11 @@ async fn check_caps(
|
||||
.remove_db(request.package_id.clone(), request.db.clone())
|
||||
.await;
|
||||
|
||||
let _ = fs::remove_dir_all(format!(
|
||||
fs::remove_dir_all(format!(
|
||||
"{}/{}/{}",
|
||||
state.kv_path, request.package_id, request.db
|
||||
));
|
||||
))
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -56,9 +56,9 @@ impl SqliteState {
|
||||
pub async fn open_db(&mut self, package_id: PackageId, db: String) -> Result<(), SqliteError> {
|
||||
let key = (package_id.clone(), db.clone());
|
||||
if self.open_dbs.contains_key(&key) {
|
||||
// let mut access_order = self.access_order.lock().await;
|
||||
// access_order.remove(&key);
|
||||
// access_order.push_back(key);
|
||||
let mut access_order = self.access_order.lock().await;
|
||||
access_order.remove(&key);
|
||||
access_order.push_back(key);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@ -515,10 +515,11 @@ async fn check_caps(
|
||||
.remove_db(request.package_id.clone(), request.db.clone())
|
||||
.await;
|
||||
|
||||
let _ = fs::remove_dir_all(format!(
|
||||
fs::remove_dir_all(format!(
|
||||
"{}/{}/{}",
|
||||
state.sqlite_path, request.package_id, request.db
|
||||
));
|
||||
))
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user