use new locking api

This commit is contained in:
Aiden McClelland
2021-09-23 18:02:18 -06:00
committed by Aiden McClelland
parent eafe7f7348
commit 8a2622c05f
13 changed files with 223 additions and 258 deletions

View File

@@ -122,7 +122,7 @@ pub async fn cleanup_failed<Db: DbHandle>(
.await?
.get(db, true)
.await?
.to_owned();
.into_owned();
if match &pde {
PackageDataEntry::Installing { .. } => true,
PackageDataEntry::Updating { manifest, .. } => {

View File

@@ -511,7 +511,7 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin>(
let mut sql_tx = ctx.secret_store.begin().await?;
crate::db::DatabaseModel::new()
.package_data()
.lock(&mut tx, patch_db::LockType::Write)
.lock(&mut tx, true)
.await;
log::info!("Install {}@{}: Creating volumes", pkg_id, version);