Skip to content

Commit

Permalink
fix ram messages and self-update handling
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Jul 27, 2024
1 parent 64bdf1d commit 6db01fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "khost"
version = "0.0.9"
version = "0.0.10"
edition = "2021"
authors = ["Kaspa developers"]
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/kaspad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ pub fn configure_networks(ctx: &mut Context, networks: Vec<Network>) -> Result<(
if networks.len() >= *nodes && ctx.system.ram_as_gb() <= (*limit - 2) {
log::error(format!(
"Detected RAM is {}, minimum required for {} networks is {} Gb. Aborting...",
nodes,
as_gb(ctx.system.total_memory as f64, false, false),
nodes,
*limit
))?;
return Ok(());
Expand Down
6 changes: 4 additions & 2 deletions src/khost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ pub fn update() -> Result<()> {
log::info(format!("Updating khost to {latest_version}"))?;
cmd!("cargo", "install", format!("khost@{latest_version}")).run()?;
log::success(format!("khost updated to {latest_version}"))?;
log::info("Starting new version...")?;
log::info("(if khost exits, please restart it)")?;
outro("Starting new version...")?;
println!();
surrender();
}
Expand All @@ -38,6 +39,7 @@ pub fn update() -> Result<()> {
}

pub fn surrender() {
let _ = cmd!("khost").run();
let current_exe = std::env::current_exe().unwrap();
let _ = duct::cmd!(current_exe).run();
std::process::exit(0);
}

0 comments on commit 6db01fe

Please sign in to comment.