fix: don't need all services to be present
this way disabling a service won't break it
This commit is contained in:
parent
7dff1a9f78
commit
12ba835223
1 changed files with 3 additions and 4 deletions
|
@ -63,10 +63,9 @@ async fn api_status(
|
||||||
let five_min_ago = (chrono::Utc::now() - chrono::Duration::minutes(5)).timestamp();
|
let five_min_ago = (chrono::Utc::now() - chrono::Duration::minutes(5)).timestamp();
|
||||||
let since = q.since.unwrap_or(five_min_ago);
|
let since = q.since.unwrap_or(five_min_ago);
|
||||||
for (sid, name) in db.services().await? {
|
for (sid, name) in db.services().await? {
|
||||||
state.insert(
|
if let Ok(up) = db.up(sid, since).await {
|
||||||
name,
|
state.insert(name, up);
|
||||||
db.up(sid, since).await?
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
Ok(Json(state))
|
Ok(Json(state))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue