Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Undoing the breaking introduced by trying to stopp #2023

Merged
merged 2 commits into from
Dec 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion backend/src/install/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,18 @@ pub async fn download_install_s9pk(
let mut previous_state: Option<MainStatus> = None;

if let Err(e) = async {
previous_state = Some(crate::control::stop_impl(ctx.clone(), pkg_id.clone()).await?);
if crate::db::DatabaseModel::new()
.package_data()
.idx_model(&pkg_id)
.and_then(|x| x.installed())
.exists(&mut ctx.db.handle())
.await
.unwrap_or(false)
{
previous_state = crate::control::stop_impl(ctx.clone(), pkg_id.clone())
.await
.ok();
}
let mut db_handle = ctx.db.handle();
let mut tx = db_handle.begin().await?;
let receipts = DownloadInstallReceipts::new(&mut tx, &pkg_id).await?;
Expand Down