This commit is contained in:
Jaakko Vanhala
2026-04-12 06:22:52 +03:00
parent ce0ccbddd3
commit 403f35efdc
9 changed files with 597 additions and 15 deletions

View File

@@ -652,6 +652,17 @@ async fn broadcast_stats(state: &Arc<AppState>) {
"tasks": completed
});
let _ = state.stats_tx.send(stats_msg.to_string());
// Uutta: Laitetaan sama tieto myös kaikille yhdistyneille solmuille (viesti Hubilta Solmuille)
let node_status = serde_json::json!({
"type": "network_status",
"active_nodes": total_nodes,
"tasks": completed
});
let msg_str = node_status.to_string();
for tx in state.node_channels.read().await.values() {
let _ = tx.send(msg_str.clone());
}
}
/// Validoi client-viesti: pakollinen "type"-kenttä, sallittu tyyppi, validi JSON