diff --git a/.github/workflows/app-release.yml b/.github/workflows/app-release.yml index a2890a0fb..88b78f7dd 100644 --- a/.github/workflows/app-release.yml +++ b/.github/workflows/app-release.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - 0.8.0-beta-fixes tags: - 'v*' paths: diff --git a/packages/app-lib/src/state/process.rs b/packages/app-lib/src/state/process.rs index 0d9413316..b4eab34d2 100644 --- a/packages/app-lib/src/state/process.rs +++ b/packages/app-lib/src/state/process.rs @@ -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; @@ -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; @@ -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")] { @@ -227,14 +237,6 @@ impl Process { } } - emit_process( - &self.profile_path, - self.pid as u32, - ProcessPayloadType::Finished, - "Exited process", - ) - .await?; - Ok(mc_exit_status) }