feat: ability to categorize
This commit is contained in:
@@ -32,7 +32,7 @@ impl Data {
|
||||
status_updated: Mutex::new((Instant::now(), false)),
|
||||
}
|
||||
}
|
||||
pub fn status_sync(&self, dbg: bool) -> MutexGuard<Status> {
|
||||
pub fn status_sync(&'_ self, dbg: bool) -> MutexGuard<'_, Status> {
|
||||
let mut updated = self.status_updated.blocking_lock();
|
||||
let now = Instant::now();
|
||||
if (now - updated.0).as_secs_f32() > 3.0 || (dbg && !updated.1) {
|
||||
@@ -47,7 +47,7 @@ impl Data {
|
||||
self.status.blocking_lock()
|
||||
}
|
||||
}
|
||||
pub async fn status_async(&self, dbg: bool) -> MutexGuard<Status> {
|
||||
pub async fn status_async(&'_ self, dbg: bool) -> MutexGuard<'_, Status> {
|
||||
let mut updated = self.status_updated.lock().await;
|
||||
let now = Instant::now();
|
||||
if (now - updated.0).as_secs_f32() > 3.0 || (dbg && !updated.1) {
|
||||
|
||||
Reference in New Issue
Block a user