(fix): connections
This commit is contained in:
parent
51dcd5de3c
commit
c999f68aa4
8 changed files with 31 additions and 363 deletions
|
|
@ -3,7 +3,6 @@ use super::{client_connection::ClientConnection, iota_connection::IotaConnection
|
|||
use crate::{data::user::UserStatus, rho::app_connection::AppConnection};
|
||||
use dashmap::DashMap;
|
||||
use mtp::codec::{CommunicationValue, DataType};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
use uuid::Uuid;
|
||||
|
|
@ -263,19 +262,6 @@ impl RhoConnection {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get ping information for all clients
|
||||
pub async fn get_client_pings(&self) -> HashMap<String, i64> {
|
||||
let connections = self.get_client_connections().await;
|
||||
let mut pings = HashMap::new();
|
||||
|
||||
for connection in connections.iter() {
|
||||
let user_id = connection.get_user_id().await;
|
||||
pings.insert(user_id.to_string(), connection.get_ping().await);
|
||||
}
|
||||
|
||||
pings
|
||||
}
|
||||
|
||||
/// Check if this RhoConnection contains a specific user ID
|
||||
#[allow(dead_code)]
|
||||
pub async fn contains_user(&self, user_id: &i64) -> bool {
|
||||
|
|
|
|||
Loading…
Reference in a new issue