mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-25 21:46:50 +00:00
scanner status command(3)
Signed-off-by: mujunxiang <1948535941@qq.com>
This commit is contained in:
@@ -9,11 +9,11 @@ use std::{
|
|||||||
atomic::{AtomicBool, AtomicU32, AtomicU64, Ordering},
|
atomic::{AtomicBool, AtomicU32, AtomicU64, Ordering},
|
||||||
Arc,
|
Arc,
|
||||||
},
|
},
|
||||||
time::{Duration, SystemTime, UNIX_EPOCH},
|
time::{Duration, SystemTime},
|
||||||
};
|
};
|
||||||
|
|
||||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||||
use chrono::{DateTime, TimeZone, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use rmp_serde::{Deserializer, Serializer};
|
use rmp_serde::{Deserializer, Serializer};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use chrono::{DateTime, Utc};
|
use chrono::Utc;
|
||||||
use common::globals::GLOBAL_Local_Node_Name;
|
use common::globals::GLOBAL_Local_Node_Name;
|
||||||
use common::last_minute::{AccElem, LastMinuteLatency};
|
use common::last_minute::{AccElem, LastMinuteLatency};
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
@@ -10,10 +10,7 @@ use std::sync::Once;
|
|||||||
use std::time::{Duration, UNIX_EPOCH};
|
use std::time::{Duration, UNIX_EPOCH};
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
sync::{
|
sync::{atomic::Ordering, Arc},
|
||||||
atomic::{AtomicU32, Ordering},
|
|
||||||
Arc,
|
|
||||||
},
|
|
||||||
time::SystemTime,
|
time::SystemTime,
|
||||||
};
|
};
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
|
|||||||
@@ -39,10 +39,9 @@ use std::task::{Context, Poll};
|
|||||||
use std::time::Duration as std_Duration;
|
use std::time::Duration as std_Duration;
|
||||||
use std::u64;
|
use std::u64;
|
||||||
use time::{Duration, OffsetDateTime};
|
use time::{Duration, OffsetDateTime};
|
||||||
use tokio::spawn;
|
use tokio::sync::mpsc::{self};
|
||||||
use tokio::sync::mpsc::error::TryRecvError;
|
|
||||||
use tokio::sync::mpsc::{self, Receiver};
|
|
||||||
use tokio::time::interval;
|
use tokio::time::interval;
|
||||||
|
use tokio::{select, spawn};
|
||||||
use tokio_stream::wrappers::ReceiverStream;
|
use tokio_stream::wrappers::ReceiverStream;
|
||||||
use tracing::{error, info, warn};
|
use tracing::{error, info, warn};
|
||||||
|
|
||||||
@@ -446,7 +445,10 @@ impl Operation for MetricsHandler {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
interval.tick().await;
|
select! {
|
||||||
|
_ = tx.closed() => { return; }
|
||||||
|
_ = interval.tick() => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user