TUI inc
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user