Another total_stake SQL fix (#5516)

This commit is contained in:
dynco-nym
2025-02-24 18:06:03 +01:00
committed by GitHub
parent 94eb362a71
commit 9de5d7213a
4 changed files with 8 additions and 4 deletions
Generated
+1 -1
View File
@@ -6366,7 +6366,7 @@ dependencies = [
[[package]]
name = "nym-node-status-api"
version = "1.0.1"
version = "1.0.2"
dependencies = [
"ammonia",
"anyhow",
@@ -3,7 +3,7 @@
[package]
name = "nym-node-status-api"
version = "1.0.1"
version = "1.0.2"
authors.workspace = true
repository.workspace = true
homepage.workspace = true
@@ -169,7 +169,7 @@ pub(crate) async fn insert_daily_node_stats(
packets_sent, packets_dropped
) VALUES (?, ?, ?, ?, ?, ?)
ON CONFLICT(node_id, date_utc) DO UPDATE SET
total_stake = nym_node_daily_mixing_stats.total_stake,
total_stake = excluded.total_stake,
packets_received = nym_node_daily_mixing_stats.packets_received + excluded.packets_received,
packets_sent = nym_node_daily_mixing_stats.packets_sent + excluded.packets_sent,
packets_dropped = nym_node_daily_mixing_stats.packets_dropped + excluded.packets_dropped
@@ -130,7 +130,11 @@ impl Monitor {
.await
.log_error("get_all_basic_nodes")?;
queries::insert_nym_nodes(&self.db_pool, nym_nodes.clone(), &bonded_node_info).await?;
queries::insert_nym_nodes(&self.db_pool, nym_nodes.clone(), &bonded_node_info)
.await
.map(|_| {
tracing::debug!("{} nym nodes written to DB!", nym_nodes.len());
})?;
let mut gateway_geodata = Vec::new();
for gateway in gateways.iter() {