initialize analytics

This commit is contained in:
41666 2022-12-11 11:33:06 -05:00
parent 004def8fbb
commit 2665a6d25f
3 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,20 @@
use async_graphql::Object;
pub struct Analytics {}
#[Object]
impl Analytics {
async fn population(&self) -> i32 {
0
}
}
#[derive(Default)]
pub struct AnalyticsQuery;
#[Object]
impl AnalyticsQuery {
async fn analytics(&self) -> Analytics {
Analytics {}
}
}

View file

@ -74,7 +74,7 @@ impl Health {
let last_event: DateTime<Utc> = row.get(0);
if last_event < Utc::now() - chrono::Duration::minutes(5) {
return (UpDown::Down, None);
return (UpDown::Down, Some(last_event));
} else {
return (UpDown::Up, Some(last_event));
}

View file

@ -1,3 +1,4 @@
mod analytics;
mod classes;
mod health;
mod population;