Skip to content

Commit

Permalink
Fix win service
Browse files Browse the repository at this point in the history
  • Loading branch information
chipsenkbeil committed Jul 6, 2023
1 parent dc7e9b5 commit eb23b4e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/win_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ fn run_service() -> windows_service::Result<()> {
let handle = thread::spawn({
move || {
debug!("Loading CLI using args from disk for {SERVICE_NAME}");
let config = Config::load()?;
let config = Config::load().expect("Failed to load config");

debug!("Parsing CLI args from disk for {SERVICE_NAME}");
let cli = Cli::initialize_from(config.args)?;
let cli = Cli::initialize_from(config.args).expect("Failed to initialize CLI");

debug!("Running CLI for {SERVICE_NAME}");
cli.run()
cli.run().expect("CLI failed during execution")
}
});

Expand All @@ -176,13 +176,7 @@ fn run_service() -> windows_service::Result<()> {
let success = loop {
if handle.is_finished() {
match handle.join() {
Ok(result) => match result {
Ok(_) => break true,
Err(x) => {
error!("{x:?}");
break false;
}
},
Ok(_) => break true,
Err(x) => {
error!("{x:?}");
break false;
Expand Down

0 comments on commit eb23b4e

Please sign in to comment.