From f6af71138c14c1f6e24c094d1d051459bf2665a6 Mon Sep 17 00:00:00 2001 From: Noah <2+noah@noreply.gitea.bluefla.re> Date: Thu, 22 Oct 2026 11:10:32 -0600 Subject: [PATCH] Publish the live operating point every control period A client watching the API during a run saw the boot-time snapshot: status was published at boot and again when the loop exited, so frequency and voltage were frozen at their starting values for the whole run. The loop now publishes each period, which is what makes the UI and the API honest while the machine is actually mining. --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index c92f828..06ea365 100644 --- a/src/main.rs +++ b/src/main.rs @@ -266,6 +266,7 @@ fn boot_hal(mut args: impl Iterator) -> Result<(), Box ); let mut client = HalClient::connect(std::path::Path::new(&socket))?; + let label = app::target_label(&config.target); for _ in 0..ticks { let hottest = client.read_temperature_mc(0).ok(); let power_w = client.read_power_w().ok().map(f32::from); @@ -284,6 +285,9 @@ fn boot_hal(mut args: impl Iterator) -> Result<(), Box client.set_fan_target(0, pwm)?; } } + // Publish every period: a client watching the API must see the live operating point, + // not the boot-time snapshot. + status.set_hardware(app::snapshot(&runtime, &label)); if let Some(reason) = runtime.stop_reason() { println!("stopped: {reason:?}"); break;