improve patch-db locking

This commit is contained in:
Aiden McClelland
2021-10-12 17:59:16 -06:00
committed by Aiden McClelland
parent a59f0b18ca
commit 492cb7440b
7 changed files with 17 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ use color_eyre::eyre::{self, eyre};
use emver::VersionRange;
use futures::TryStreamExt;
use http::StatusCode;
use patch_db::DbHandle;
use patch_db::{DbHandle, LockType};
use reqwest::Response;
use rpc_toolkit::command;
use tokio::fs::{File, OpenOptions};
@@ -532,7 +532,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, true)
.lock(&mut tx, LockType::Write)
.await;
tracing::info!("Install {}@{}: Creating volumes", pkg_id, version);