[Fix] no block on client closing
This commit is contained in:
parent
196b663fc6
commit
65ec3941b3
1 changed files with 7 additions and 3 deletions
|
|
@ -102,9 +102,13 @@ impl RhoConnection {
|
|||
let target_user_id = connection.get_user_id().await;
|
||||
{
|
||||
let mut connections = self.client_connections.write().await;
|
||||
connections.retain(|con| {
|
||||
futures::executor::block_on(async { con.get_user_id().await != target_user_id })
|
||||
});
|
||||
let mut keep = Vec::new();
|
||||
for con in connections.drain(..) {
|
||||
if con.get_user_id().await != target_user_id {
|
||||
keep.push(con);
|
||||
}
|
||||
}
|
||||
*connections = keep;
|
||||
}
|
||||
|
||||
// Notify OmegaConnection
|
||||
|
|
|
|||
Loading…
Reference in a new issue