Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchinchilla committed Jan 9, 2025
1 parent 4a82628 commit cff19d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 2 additions & 5 deletions binaries/geph5-broker/src/rpc_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,8 @@ impl BrokerProtocol for BrokerImpl {
)
.await
{
match route {
Ok(route) => routes.push(route),
Err(err) => {
tracing::warn!(err = debug(err), "could not communicate")
}
if let Ok(route) = route {
routes.push(route)
}
}

Expand Down
6 changes: 6 additions & 0 deletions binaries/geph5-broker/src/self_stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ pub async fn self_stat_loop() -> anyhow::Result<()> {
.fetch_one(&*POSTGRES)
.await?;
client.gauge("broker.daily_logins", daily_logins as f64)?;
let (weekly_logins,): (i64,) = sqlx::query_as(
"select count(id) from last_login where login_time > NOW() - INTERVAL '7 days'",
)
.fetch_one(&*POSTGRES)
.await?;
client.gauge("broker.weekly_logins", weekly_logins as f64)?;
}
async_io::Timer::after(Duration::from_secs(5)).await;
}
Expand Down

0 comments on commit cff19d4

Please sign in to comment.