fix lock ordering

This commit is contained in:
Keagan McClelland
2022-01-10 15:02:43 -07:00
committed by Aiden McClelland
parent 8c1016b3eb
commit d3ab3cb46b

View File

@@ -24,12 +24,12 @@ pub async fn set_eos_url(#[context] ctx: RpcContext, #[arg] url: Url) -> Result<
pub async fn set_package_url(#[context] ctx: RpcContext, #[arg] url: Url) -> Result<(), Error> {
let mut db = ctx.db.handle();
let mut tx = db.begin().await?;
ctx.set_nginx_conf(&mut tx).await?;
crate::db::DatabaseModel::new()
.server_info()
.package_marketplace()
.put(&mut tx, &Some(url))
.await?;
ctx.set_nginx_conf(&mut tx).await?;
tx.commit(None).await?;
Ok(())
}