Skip to content

Commit

Permalink
run actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Aug 14, 2024
1 parent 264055d commit fd3b619
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- 0.8.0-beta-fixes
tags:
- 'v*'
paths:
Expand Down
24 changes: 13 additions & 11 deletions packages/app-lib/src/state/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@ impl Process {

loop {
if let Some(t) = self.try_wait().await? {
println!("Minecraft Child exited with status {} pid: {}", t, self.pid);
mc_exit_status = t;
break;
}
println!("Still running Minecraft Child pid: {}", self.pid);
// sleep for 10ms
tokio::time::sleep(tokio::time::Duration::from_millis(50)).await;

Expand All @@ -177,6 +179,17 @@ impl Process {
.await;
}

let state = crate::State::get().await?;
Self::remove(self.pid as u32, &state.pool).await?;

emit_process(
&self.profile_path,
self.pid as u32,
ProcessPayloadType::Finished,
"Exited process",
)
.await?;

// Now fully complete- update playtime one last time
update_playtime(&mut last_updated_playtime, &self.profile_path, true)
.await;
Expand All @@ -197,11 +210,8 @@ impl Process {
}
});

let state = crate::State::get().await?;
let _ = state.discord_rpc.clear_to_default(true).await;

Self::remove(self.pid as u32, &state.pool).await?;

// If in tauri, window should show itself again after process exists if it was hidden
#[cfg(feature = "tauri")]
{
Expand All @@ -227,14 +237,6 @@ impl Process {
}
}

emit_process(
&self.profile_path,
self.pid as u32,
ProcessPayloadType::Finished,
"Exited process",
)
.await?;

Ok(mc_exit_status)
}

Expand Down

0 comments on commit fd3b619

Please sign in to comment.