v0.13.2
This commit is contained in:
@@ -198,9 +198,8 @@ fn record_poll_failure(device: &mut Device, error: &str) {
|
||||
fn register_device_failure(state: &AppState, device: &mut Device, error: &str) -> Result<(), AppError> {
|
||||
record_poll_failure(device, error);
|
||||
state.db.save_device(device)?;
|
||||
// Command failures can change online/communication health without a device.updated frame.
|
||||
// Keep the materialized plan current explicitly instead of relying on log-event prefixes.
|
||||
state.invalidate_control_plan();
|
||||
// Command failures change live communication health; publish the updated snapshot immediately.
|
||||
state.broadcast("device.updated", serde_json::to_value(&*device)?);
|
||||
state.log("warn", "device.communication_error", &format!("{}: {error}", device.name), json!({
|
||||
"device_id": device.id,
|
||||
"consecutive_failures": device.communication_failures,
|
||||
|
||||
Reference in New Issue
Block a user