Skip to content

Commit

Permalink
cli: wipe_ostree in spawn_blocking
Browse files Browse the repository at this point in the history
Solves #777

Signed-off-by: Omer Tuchfeld <[email protected]>
  • Loading branch information
omertuc committed Sep 6, 2024
1 parent 1ba8d1e commit efb0d36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use ostree_ext::keyfileext::KeyFileExt;
use ostree_ext::ostree;
use schemars::schema_for;

use crate::deploy::wipe_ostree;
use crate::deploy::RequiredHostSpec;
use crate::lints;
use crate::spec::Host;
Expand Down Expand Up @@ -929,7 +928,7 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
StateOpts::WipeOstree => {
let sysroot = ostree::Sysroot::new_default();
sysroot.load(gio::Cancellable::NONE)?;
wipe_ostree(&sysroot).await?;
tokio::task::spawn_blocking(move || crate::deploy::wipe_ostree(&sysroot)).await??;
Ok(())
}
},
Expand Down
2 changes: 1 addition & 1 deletion lib/src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ pub(crate) async fn prune_container_store(sysroot: &Storage) -> Result<()> {
Ok(())
}

pub(crate) async fn wipe_ostree(sysroot: &Sysroot) -> Result<()> {
pub(crate) fn wipe_ostree(sysroot: &Sysroot) -> Result<()> {
sysroot
.write_deployments(&[], gio::Cancellable::NONE)
.context("removing deployments")?;
Expand Down

0 comments on commit efb0d36

Please sign in to comment.