From 12ba835223fa93922e1b7d5e6cc409c29f6e5528 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 10 Dec 2024 22:01:43 +0100 Subject: [PATCH] fix: don't need all services to be present this way disabling a service won't break it --- src/api.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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)) }