scanner status command(3)

Signed-off-by: mujunxiang <1948535941@qq.com>
This commit is contained in:
mujunxiang
2024-12-03 10:14:46 +08:00
parent f707639392
commit bedc81e973
3 changed files with 10 additions and 11 deletions
+2 -2
View File
@@ -9,11 +9,11 @@ use std::{
atomic::{AtomicBool, AtomicU32, AtomicU64, Ordering},
Arc,
},
time::{Duration, SystemTime, UNIX_EPOCH},
time::{Duration, SystemTime},
};
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use chrono::{DateTime, TimeZone, Utc};
use chrono::{DateTime, Utc};
use lazy_static::lazy_static;
use rand::Rng;
use rmp_serde::{Deserializer, Serializer};
+2 -5
View File
@@ -1,4 +1,4 @@
use chrono::{DateTime, Utc};
use chrono::Utc;
use common::globals::GLOBAL_Local_Node_Name;
use common::last_minute::{AccElem, LastMinuteLatency};
use lazy_static::lazy_static;
@@ -10,10 +10,7 @@ use std::sync::Once;
use std::time::{Duration, UNIX_EPOCH};
use std::{
collections::HashMap,
sync::{
atomic::{AtomicU32, Ordering},
Arc,
},
sync::{atomic::Ordering, Arc},
time::SystemTime,
};
use tokio::sync::RwLock;
+6 -4
View File
@@ -39,10 +39,9 @@ use std::task::{Context, Poll};
use std::time::Duration as std_Duration;
use std::u64;
use time::{Duration, OffsetDateTime};
use tokio::spawn;
use tokio::sync::mpsc::error::TryRecvError;
use tokio::sync::mpsc::{self, Receiver};
use tokio::sync::mpsc::{self};
use tokio::time::interval;
use tokio::{select, spawn};
use tokio_stream::wrappers::ReceiverStream;
use tracing::{error, info, warn};
@@ -446,7 +445,10 @@ impl Operation for MetricsHandler {
break;
}
interval.tick().await;
select! {
_ = tx.closed() => { return; }
_ = interval.tick() => {}
}
}
});