Refact. Replace all tokio::time::interval() (#7173)

* Refact. Replace all `tokio::time::interval()`

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* Refact Better min_interval for `ThrottledInterval`.

Signed-off-by: fufesou <shuanglongchen@yeah.net>

---------

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2024-02-18 21:18:00 +08:00
committed by GitHub
parent 5fdcc748e1
commit 8c108065eb
9 changed files with 153 additions and 39 deletions

View File

@@ -442,7 +442,8 @@ pub mod server {
match ipc::connect(1000, postfix).await {
Ok(mut stream) => {
let mut timer = tokio::time::interval(Duration::from_secs(1));
let mut timer =
crate::rustdesk_interval(tokio::time::interval(Duration::from_secs(1)));
let mut nack = 0;
loop {
tokio::select! {
@@ -777,7 +778,7 @@ pub mod client {
tokio::spawn(async move {
let mut stream = Connection::new(stream);
let postfix = postfix.to_owned();
let mut timer = tokio::time::interval(Duration::from_secs(1));
let mut timer = crate::rustdesk_interval(tokio::time::interval(Duration::from_secs(1)));
let mut nack = 0;
let mut rx = rx_clone.lock().await;
loop {