diff --git a/src/api.rs b/src/api.rs index 849572c..5132248 100644 --- a/src/api.rs +++ b/src/api.rs @@ -63,10 +63,9 @@ async fn api_status( let five_min_ago = (chrono::Utc::now() - chrono::Duration::minutes(5)).timestamp(); let since = q.since.unwrap_or(five_min_ago); for (sid, name) in db.services().await? { - state.insert( - name, - db.up(sid, since).await? - ); + if let Ok(up) = db.up(sid, since).await { + state.insert(name, up); + } } Ok(Json(state)) }