mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-16 12:01:29 +03:00
debug, query_onlines_block_thread
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
@@ -572,7 +572,6 @@ async fn direct_server(server: ServerPtr) {
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
pub async fn query_online_states<F: FnOnce(Vec<String>, Vec<String>)>(ids: Vec<String>, f: F) {
|
||||
let test = false;
|
||||
if test {
|
||||
@@ -598,7 +597,11 @@ pub async fn query_online_states<F: FnOnce(Vec<String>, Vec<String>)>(ids: Vec<S
|
||||
}
|
||||
|
||||
if query_begin.elapsed() > query_timeout {
|
||||
log::debug!("query onlines timeout {:?} ({:?})", query_begin.elapsed(), query_timeout);
|
||||
log::debug!(
|
||||
"query onlines timeout {:?} ({:?})",
|
||||
query_begin.elapsed(),
|
||||
query_timeout
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -679,8 +682,10 @@ async fn query_online_states_(
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn test_query_onlines() {
|
||||
use hbb_common::tokio;
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_query_onlines() {
|
||||
super::query_online_states(
|
||||
vec![
|
||||
"152183996".to_owned(),
|
||||
@@ -691,6 +696,7 @@ mod tests {
|
||||
|onlines: Vec<String>, offlines: Vec<String>| {
|
||||
println!("onlines: {:?}, offlines: {:?}", &onlines, &offlines);
|
||||
},
|
||||
);
|
||||
)
|
||||
.await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user