Merge pull request #34 from jokeyrhyme/optional-systemd-target

fix: allow calls for systemd graphical target to fail
This commit is contained in:
Victoria Brekenfeld 2024-01-16 20:49:56 +01:00 committed by GitHub
commit efe4b58279
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 23 deletions

View file

@ -110,15 +110,13 @@ async fn start(
)
.wrap_err("failed to start compositor")?;
sleep(Duration::from_millis(2000)).await;
systemd::start_systemd_target()
.await
.wrap_err("failed to start systemd target")?;
systemd::start_systemd_target().await;
// Always stop the target when the process exits or panics.
scopeguard::defer! {
if let Err(error) = systemd::stop_systemd_target() {
error!("failed to stop systemd target: {:?}", error);
}
systemd::stop_systemd_target();
}
let env_vars = env_rx
.await
.expect("failed to receive environmental variables")