use template
This commit is contained in:
@@ -8,11 +8,12 @@ const REDIRECT: &'static str = "/srv/tomatenmhark-redirect/";
|
||||
pub struct Status(
|
||||
pub BTreeMap<String, (bool, bool, String, Option<String>, Option<Duration>)>,
|
||||
pub BTreeMap<String, (bool, bool, String, Option<String>)>,
|
||||
pub Duration,
|
||||
);
|
||||
impl Status {
|
||||
pub fn empty() -> Self {
|
||||
Self(Default::default(), Default::default())
|
||||
}
|
||||
pub fn query_sync(dbg: bool) -> Self {
|
||||
let start = Instant::now();
|
||||
let mut map = BTreeMap::new();
|
||||
query_status_sync(
|
||||
|k, e, r, v, dur| {
|
||||
@@ -75,10 +76,9 @@ impl Status {
|
||||
}
|
||||
}
|
||||
}
|
||||
Self(map, rest, start.elapsed())
|
||||
Self(map, rest)
|
||||
}
|
||||
pub async fn query_async(dbg: bool) -> Self {
|
||||
let start = Instant::now();
|
||||
let mut map = BTreeMap::new();
|
||||
query_status_async(
|
||||
|k, e, r, v, dur| {
|
||||
@@ -137,7 +137,7 @@ impl Status {
|
||||
}
|
||||
}
|
||||
}
|
||||
Self(map, rest, start.elapsed())
|
||||
Self(map, rest)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user