[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 target_user_id = connection.get_user_id().await;
|
||||||
{
|
{
|
||||||
let mut connections = self.client_connections.write().await;
|
let mut connections = self.client_connections.write().await;
|
||||||
connections.retain(|con| {
|
let mut keep = Vec::new();
|
||||||
futures::executor::block_on(async { con.get_user_id().await != target_user_id })
|
for con in connections.drain(..) {
|
||||||
});
|
if con.get_user_id().await != target_user_id {
|
||||||
|
keep.push(con);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*connections = keep;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify OmegaConnection
|
// Notify OmegaConnection
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue